Click here to Skip to main content
15,918,193 members

Survey Results

Do you wrap single line statements in braces (or begin/end)?   [Edit]

Survey period: 16 May 2011 to 23 May 2011

Do you:

if (condition)
    statement
or
if (condition)
{
    statement
}
(Replace {}'s with Begin/End or whatever is appropriate for your language du jour)

OptionVotes% 
I always wrap single line statements95548.04
I sometimes wrap single line statements57328.82
I never wrap single line statements - only multiple lines get wrapped.46023.14



 
GeneralRe: Neither Pin
QuiJohn16-May-11 10:31
QuiJohn16-May-11 10:31 
GeneralRe: Neither Pin
Paul Klomp16-May-11 20:15
Paul Klomp16-May-11 20:15 
GeneralRe: Neither Pin
petriiik16-May-11 21:42
petriiik16-May-11 21:42 
GeneralRe: Neither Pin
QuiJohn17-May-11 4:27
QuiJohn17-May-11 4:27 
GeneralRe: Neither Pin
Kevin McFarlane21-May-11 6:08
Kevin McFarlane21-May-11 6:08 
GeneralRe: Neither Pin
Roger Allen16-May-11 23:42
Roger Allen16-May-11 23:42 
GeneralRe: Neither Pin
QuiJohn17-May-11 4:32
QuiJohn17-May-11 4:32 
GeneralRe: Neither Pin
charlieg18-May-11 14:33
charlieg18-May-11 14:33 
gag (sticking finger down throat...)

toss in a pair of parens:

if ( (a != 3) && (a != 5) )
{
... do something useful
}

If the conditional is quite long, the perhaps break it across two lines,
but have you ever noticed that coding standards (nothing wrong with them) have
not evolved past 80 char terminals?
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.

"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759


GeneralRe: Neither Pin
Kevin McFarlane21-May-11 6:12
Kevin McFarlane21-May-11 6:12 
GeneralRe: Neither Pin
Kevin McFarlane21-May-11 6:18
Kevin McFarlane21-May-11 6:18 
GeneralRe: Neither Pin
Mike Hankey16-May-11 9:06
mveMike Hankey16-May-11 9:06 
GeneralRe: Neither Pin
PatmanV17-May-11 0:04
PatmanV17-May-11 0:04 
GeneralRe: Neither Pin
peterchen16-May-11 23:51
peterchen16-May-11 23:51 
GeneralRe: Neither Pin
Mladen Janković17-May-11 4:52
Mladen Janković17-May-11 4:52 
GeneralNope Pin
OriginalGriff16-May-11 3:55
mveOriginalGriff16-May-11 3:55 
GeneralRe: Nope Pin
Albert Holguin16-May-11 7:21
professionalAlbert Holguin16-May-11 7:21 
GeneralRe: Nope Pin
Mike Hankey16-May-11 9:07
mveMike Hankey16-May-11 9:07 
GeneralRe: Nope Pin
OriginalGriff16-May-11 9:16
mveOriginalGriff16-May-11 9:16 
GeneralRe: Nope Pin
Mike Hankey16-May-11 9:46
mveMike Hankey16-May-11 9:46 
GeneralRe: Nope Pin
OriginalGriff16-May-11 9:49
mveOriginalGriff16-May-11 9:49 
GeneralRe: Nope Pin
Johnny J.16-May-11 21:02
professionalJohnny J.16-May-11 21:02 
GeneralRe: Nope Pin
OriginalGriff16-May-11 21:25
mveOriginalGriff16-May-11 21:25 
GeneralRe: Nope Pin
Geekian_senate16-May-11 13:22
Geekian_senate16-May-11 13:22 
GeneralRe: Nope Pin
Nagy Vilmos17-May-11 2:01
professionalNagy Vilmos17-May-11 2:01 
GeneralSince everyone brag about consistency and readability Pin
Mladen Janković16-May-11 3:39
Mladen Janković16-May-11 3:39 

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.