Click here to Skip to main content
16,005,467 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 
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 
Aside from the spacing, my style is very similar.  The only major difference is that I also use compound statements for "case" code.  For example:

switch( iSomeVal )
{
    case 0:
    {
        DoSomething();
        DoSomethingElse();
        break;
    }
    // Etc...
}

   I do that because the code between a "case" and a "break" (or a fall-through) is treated as a compound statement, and I want it to look like that.

   Strange, I know!  But I never said that I was "normal". Smile | :)

Peace!

-=- James.
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.