Click here to Skip to main content
15,921,174 members

Survey Results

Where should the braces go?   [Edit]

Survey period: 25 Feb 2001 to 3 Mar 2001

What is your preference for placing braces. See the braces page for a list of options.

OptionVotes% 
Braces starting on control line12215.60
Braces starting on line under control line, non-indented56472.12
Braces starting on line under control line, indented729.21
Braces starting on control line, closeing brace indented162.05
Other (please demonstrate!)81.02



 
GeneralClear and clean code Pin
5-Mar-01 5:37
suss5-Mar-01 5:37 
I never liked the 'Braces starting on control line' because i always have a hard time finding or spotting the brace on the first look.

Some people also write code that is so hard to read because it is all compacted on few lines. I dont think that the speed at which code is written should have precedence on the clearness and effectiveness of code.

I think a nice and simple rule is to write code keeping in mind that other people may use it or need to work on it. Especially in a team of programmers, would you accept different styles ? I dont, as long as the difference is not confusing to others and to me. As for braces, I've always prefered the 'Braces starting on line under control line, non-indented' format, and i can see i am not alone. That is also the programming style i learned back then (1986 or so). It clearly shows the starting of new block for the controlling command. No confusion and clear code.

So in conclusion, keep in clear and clean.

Happy coding to all Smile | :)

Louis.

GeneralRe: Clear and clean code Pin
5-Mar-01 7:37
suss5-Mar-01 7:37 
GeneralRe: Clear and clean code Pin
5-Mar-01 8:29
suss5-Mar-01 8:29 
GeneralRe: Clear and clean code Pin
Alvaro Mendez5-Mar-01 12:53
Alvaro Mendez5-Mar-01 12:53 
GeneralRe: Clear and clean code Pin
6-Mar-01 5:08
suss6-Mar-01 5:08 
GeneralRe: Clear and clean code Pin
James R. Twine6-Mar-01 6:26
James R. Twine6-Mar-01 6:26 
GeneralRe: Clear and clean code Pin
11-Mar-01 14:46
suss11-Mar-01 14:46 
GeneralRe: Clear and clean code Pin
13-Mar-01 6:43
suss13-Mar-01 6:43 
GeneralRe: Clear and clean code Pin
13-Mar-01 6:43
suss13-Mar-01 6:43 
Generalif-else, while, for, switch Pin
2-Mar-01 6:23
suss2-Mar-01 6:23 
GeneralRe: if-else, while, for, switch Pin
GeVanCo3-Mar-01 7:41
GeVanCo3-Mar-01 7:41 
GeneralRe: if-else, while, for, switch Pin
James R. Twine3-Mar-01 9:20
James R. Twine3-Mar-01 9:20 
GeneralRe: if-else, while, for, switch Pin
Christian Graus3-Mar-01 14:13
protectorChristian Graus3-Mar-01 14:13 
GeneralRe: if-else, while, for, switch Pin
GeVanCo3-Mar-01 20:32
GeVanCo3-Mar-01 20:32 
GeneralRe: if-else, while, for, switch Pin
4-Mar-01 14:49
suss4-Mar-01 14:49 
GeneralRe: if-else, while, for, switch Pin
George5-Mar-01 2:02
George5-Mar-01 2:02 
GeneralRe: if-else, while, for, switch Pin
James R. Twine5-Mar-01 2:40
James R. Twine5-Mar-01 2:40 
GeneralHow if-else ? Pin
1-Mar-01 23:53
suss1-Mar-01 23:53 
GeneralRe: How if-else ? Pin
James R. Twine3-Mar-01 9:14
James R. Twine3-Mar-01 9:14 
General... followup question: do you use the same format that your tutor did (incl favourate book) Pin
jkgh28-Feb-01 7:41
jkgh28-Feb-01 7:41 
GeneralRe: ... followup question: do you use the same format that your tutor did (incl favourate book) Pin
James R. Twine28-Feb-01 8:53
James R. Twine28-Feb-01 8:53 
GeneralRe: ... followup question: do you use the same format that your tutor did (incl favourate book) Pin
Chris Losinger28-Feb-01 9:02
professionalChris Losinger28-Feb-01 9:02 
GeneralRe: ... followup question: do you use the same format that your tutor did (incl favourate book) Pin
Gavin Greig28-Feb-01 22:56
Gavin Greig28-Feb-01 22:56 
GeneralRe: ... followup question: do you use the same format that your tutor did (incl favourate book) Pin
Chris Losinger1-Mar-01 4:17
professionalChris Losinger1-Mar-01 4:17 
GeneralRE: uncomfortable standards Pin
Sir Gras of Berger1-Mar-01 7:21
Sir Gras of Berger1-Mar-01 7:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.