Click here to Skip to main content
15,894,343 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



 
AnswerI never wrap single line statements - only multiple lines get wrapped. [modified] Pin
Prasad CM23-Jun-11 0:09
Prasad CM23-Jun-11 0:09 
GeneralI answered second Pin
Kevin McFarlane21-May-11 5:56
Kevin McFarlane21-May-11 5:56 
GeneralRe: I answered second Pin
Christian Graus21-May-11 10:22
protectorChristian Graus21-May-11 10:22 
GeneralRe: I answered second Pin
Anand Ranjan Pandey21-May-11 10:37
professionalAnand Ranjan Pandey21-May-11 10:37 
GeneralRe: I answered second Pin
Kiran Sonawane28-Jun-11 20:54
Kiran Sonawane28-Jun-11 20:54 
GeneralWow, Looks like most people do it wrong. Pin
Matt Gerrans20-May-11 19:07
Matt Gerrans20-May-11 19:07 
GeneralRe: Wow, Looks like most people do it wrong. Pin
PIEBALDconsult21-May-11 7:47
mvePIEBALDconsult21-May-11 7:47 
GeneralRe: Wow, Looks like most people do it wrong. Pin
Amar Chaudhary21-May-11 23:19
Amar Chaudhary21-May-11 23:19 
GeneralRe: Wow, Looks like most people do it wrong. Pin
Dávid Kocsis22-May-11 9:04
Dávid Kocsis22-May-11 9:04 
GeneralRe: Wow, Looks like most people do it wrong. Pin
hfrmobile24-May-11 11:49
hfrmobile24-May-11 11:49 
GeneralCode Normalization Pin
Rafael Cabral19-May-11 2:03
Rafael Cabral19-May-11 2:03 
GeneralVB.NET "Single line" is wrapped Pin
Mark Hurd18-May-11 16:34
Mark Hurd18-May-11 16:34 
GeneralFormat Document [modified] Pin
Hossein Montazeri18-May-11 4:34
professionalHossein Montazeri18-May-11 4:34 
GeneralRe: Format Document Pin
Ennis Ray Lynch, Jr.19-May-11 5:38
Ennis Ray Lynch, Jr.19-May-11 5:38 
GeneralRe: Format Document Pin
Hossein Montazeri19-May-11 22:00
professionalHossein Montazeri19-May-11 22:00 
first of all I meant people's own code.
also I don't see anything wrong with indenting the code so one wouldn't perceive:
if (condition)
    statement1;
    statement2; 

as:
if (condition)
{
    statement1;
    statement2;
}

instead would be like:
if (condition)
    statement1;
statement2; 

also I don't consider caring about tidiness and readability of the code arrogance.
another reason for me to auto format the code is that source control tools such as SVN wouldn't consider every line of code "changed" only because of some tab or space changes and cause conflicts between different versions.

Cheers
H.M.
GeneralHah. Pin
Pete O'Hanlon18-May-11 3:28
mvePete O'Hanlon18-May-11 3:28 
GeneralI always wrap Pin
Russell Jones18-May-11 2:14
Russell Jones18-May-11 2:14 
GeneralI always Wrap Pin
Sunil Gajjar [India]17-May-11 23:04
Sunil Gajjar [India]17-May-11 23:04 
GeneralI always wrap single line statements... Pin
Lizandro Campbell17-May-11 9:30
professionalLizandro Campbell17-May-11 9:30 
GeneralAlways... Pin
CodingLover17-May-11 19:40
CodingLover17-May-11 19:40 
GeneralRe: I always wrap single line statements... Pin
RedSonja17-May-11 19:53
RedSonja17-May-11 19:53 
GeneralRe: I always wrap single line statements... Pin
Pong D. Panda20-May-11 19:19
Pong D. Panda20-May-11 19:19 
GeneralRe: I always wrap single line statements... Pin
Kevin McFarlane21-May-11 5:51
Kevin McFarlane21-May-11 5:51 
GeneralI always wrap Pin
Sheo Narayan17-May-11 6:06
Sheo Narayan17-May-11 6:06 
GeneralSchizo? Pin
quinton196917-May-11 4:25
quinton196917-May-11 4:25 

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.