To view parent comment, click here.
To read all comments associated with this story, please click here.
Not just a matter of aesthetics; it also depends on the tools you use.
With XEmacs, when the cursor is at a closing brace, the line with the matching opening brace is shown in the status bar.
With this setup, it is advantageous to place the opening brace and function definition on the same line for quick reference.
I also think it depends on the language you are writing in where you should put it.
e.g.
If it is JavaScript Douglas Crockford recommends the opening brace should be on the first line, because of JavaScript semi-colon insertion mechanism.
Java is the same due to convention. Microsoft recommend you use opening brace on the following line as you do when writing C# and is the visual studio intellisense default.
Personally I somewhat agree with the OP and I have had a gutful of C style syntax.
Same, Allman style is the best!
Especially when programmers tend to have atleast 1200 pixels of height on their screens (well atleast I hope programmers are smarter than average consumer and don't give in into 16:9 fad just because it's cheaper for Samsung to make 23" 16:9 than 23" 16:10...).
Edited 2013-01-16 11:04 UTC
Please, be my guest :
http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid...
Especially check my CSkinProgress and WaterMarker source code : space instead of tab, 2 space indent, hungarian notation, one instruction per line, etc...
Kochise




Member since:
2006-05-09
You'll learn to love them; like the most of us
You can start flamewars just because of mentioning where the curly braces should be!!
I actually prefer writing:
int main()
{
}
to
int main() {
}
but, apart of feeling it more natural and making easier to see where a block starts and ends, I do not have any excuse to prefer it over the other one.