| |||
Views: 88,543,529 |
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search | 05-06-24 02:06 AM |
|
Guest: Register | Login |
0 users currently in Computing | 1 guest |
Main - Computing - Programming Poll #5: { } | New thread | New reply |
GuyPerfect |
| ||
Paratroopa Level: 30 Posts: 3/155 EXP: 152717 Next: 13152 Since: 03-14-07 Last post: 6055 days Last view: 6004 days |
{ and }, in the world of programming documentation, are quite commonly referred to as "Curly Braces," while I just personally call them "Braces." The < and >, FYIngly enough, are "comparison brackets."
When using languages with braces, I do the good ol': int main(int argc, char **argv) { I don't see a real need to put the brace on the next line. I mean, if you have more than one statement, you need a brace, and I always indent under such circumstances. To me, the first line in the block introduces the indentation, and the closing brace signals its end. If there is only one statement within the block, I will rarely, if ever (never happened yet) include the braces. Depending on the length of the line, however, I have been known to newline and intent as if there were braces. Example: if (ThingImTestingFor == 2) |
Cellar Dweller |
| ||
Snifit Level: 39 Posts: 14/287 EXP: 385482 Next: 19289 Since: 02-19-07 From: Arkansas Last post: 4061 days Last view: 3229 days |
1. Curly braces, as others have stated.
2. My code is 1TBS compliant. 3. I generally use braces even if one one line is in the block. This is a habit that solidified during my brief experience with Perl, in which the braces are manditory. If anyone wants to see some of my code, I have already posted a code sample in another thread. Posted by Kernal In my case, I don't line up brace to brace, I line up the ending brace to the control construct that precedes the block of code. |
Main - Computing - Programming Poll #5: { } | New thread | New reply |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 42, rows: 52/53, time: 0.017 seconds. |