Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

A question about C indent styles

Name: Anonymous 2016-07-25 7:26

Is there any particular reason why it is so uncommon to put the opening brace of a function on the same line as the function declaration? As in
int main (int argc, char* argv[]) {
/* ... */
return 0;
}

The vast majority of C code examples I've seen put the opening brace on its own line in functions, even when they don't do so for if and while statements and so on. Is there any reason for this apparent inconsistency? Personally, I tend to use the above style for everything - functions, loops, structs, etc. And while that kind of brace style is widespread in K&R/1TBS style, it seems to be almost never used for functions.

Name: Anonymous 2016-08-06 21:07

>>23
Now when you were in there, would you take the time to "correct" the formatting? [...] If you do decide to make those additional fixes, who is actually benefiting from them?
I do, because my autism stops after investing 5 seconds in formatting it and I can then concentrate on the actual problem.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List