Re:The Facts Behind the Code Indention Style War
by scott_s on Tuesday July 07, 2009 @10:37AM
(#691523)
I use K&R style for control structures (loops, if/else), but function braces get their own line. Braces for classes, structs and namespaces go on the same line.
I'm not worried about obsessing about compact code; this style just looks best to me. I'm consistent with my formatting, so I can glance at my code and know what I'm looking at. Actually, I can literally unfocus my eyes and I still know if I'm looking at a function, control structure within a function, or a class definition.
The important part, where taste comes in, is where code gets separated by empty lines. I consider code separated by empty lines akin to paragraphs.
I'm not worried about obsessing about compact code; this style just looks best to me. I'm consistent with my formatting, so I can glance at my code and know what I'm looking at. Actually, I can literally unfocus my eyes and I still know if I'm looking at a function, control structure within a function, or a class definition.
The important part, where taste comes in, is where code gets separated by empty lines. I consider code separated by empty lines akin to paragraphs.
For the reocrd, my indent settings: