Click here to Skip to main content
15,886,963 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: I don't wrap at some places like... Pin
thatraja16-May-11 5:40
professionalthatraja16-May-11 5:40 
GeneralSingle statements without braces are more readable. Pin
GPUToaster™15-May-11 18:53
GPUToaster™15-May-11 18:53 
GeneralRe: Single statements without braces are more readable. Pin
Jigar K Oza15-May-11 18:55
Jigar K Oza15-May-11 18:55 
GeneralRe: Single statements without braces are more readable. Pin
Niklas L15-May-11 20:30
Niklas L15-May-11 20:30 
GeneralRe: Single statements without braces are more readable. Pin
Jigar K Oza15-May-11 20:56
Jigar K Oza15-May-11 20:56 
GeneralRe: Single statements without braces are more readable. Pin
Niklas L15-May-11 21:02
Niklas L15-May-11 21:02 
GeneralRe: Single statements without braces are more readable. Pin
Jigar K Oza15-May-11 21:17
Jigar K Oza15-May-11 21:17 
GeneralRe: Single statements without braces are more readable. Pin
Niklas L15-May-11 21:41
Niklas L15-May-11 21:41 
You are talking about readability in general, which is not what the poll is about. It compares two styles. Some say the one is more readable, some say the other. If you for a second forget your own preferences, it's not hard to see that readability here is just a matter of what style one's used to. So, I'm saying readability is not the issue here. The two styles can however have other benefits over the other.

Only because you say apples taste better than pears, doesn't mean you're right. It doesn't mean you're wrong either, if you see what I mean.
GeneralRe: Single statements without braces are more readable. Pin
Jigar K Oza15-May-11 22:46
Jigar K Oza15-May-11 22:46 
GeneralRe: Single statements without braces are more readable. Pin
Ravi Sant15-May-11 23:11
Ravi Sant15-May-11 23:11 
GeneralI always wrap single line statements Pin
Amar Chaudhary15-May-11 18:17
Amar Chaudhary15-May-11 18:17 
GeneralRe: I always wrap single line statements Pin
Rob Grainger15-May-11 23:02
Rob Grainger15-May-11 23:02 
GeneralRe: I always wrap single line statements Pin
Ravi Sant15-May-11 23:11
Ravi Sant15-May-11 23:11 

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.