Click here to Skip to main content
15,921,203 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 
Well, i think you have to go back and check your books.

Writting:

if( a == 2 )
{
c = b + a;
}
else
{
c = b;
}

will produce the same code as:

if(a==2) c=b+a; else c=b;

Just check the assembler output from the compiler.

And you say:
'Try to minimize the length of variable names, avoid multiline comments'

Holy!! this has absolutely no incidence on execution speed. Comments are just in your souce file andd produce no machine code whatsoever. Variable length...dah.

If you learned this from your tutor, then i am very sorry, but you have been missled badly Frown | :( If not, I to have to say that you are a funny guy Smile | :)

BTW, are you to shy of your response to put your name with it ?

cheers.
Louis.

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.