Click here to Skip to main content
15,878,945 members

Survey Results

Braces around single line commands. Needed or not?

Survey period: 12 Feb 2018 to 19 Feb 2018

It's just about the braces. Not about whether the leading brace should or should not be on the same line as the conditional. One war at a time.

OptionVotes% 
I prefer

if (condition)
  statement;
21323.20
I prefer

if (condition)
{
  statement;
}
54158.93
It depends16417.86



 
GeneralAlways use curly braces Pin
ZurdoDev12-Feb-18 2:14
professionalZurdoDev12-Feb-18 2:14 
GeneralI prefer... Pin
Slacker00712-Feb-18 1:32
professionalSlacker00712-Feb-18 1:32 
GeneralRe: I prefer... Pin
ZurdoDev12-Feb-18 2:10
professionalZurdoDev12-Feb-18 2:10 
GeneralRe: I prefer... Pin
Slacker00712-Feb-18 2:12
professionalSlacker00712-Feb-18 2:12 
GeneralRe: I prefer... Pin
W Balboos, GHB12-Feb-18 2:52
W Balboos, GHB12-Feb-18 2:52 
GeneralThe usual b&tching Pin
W Balboos, GHB12-Feb-18 0:23
W Balboos, GHB12-Feb-18 0:23 
GeneralRe: The usual b&tching Pin
Slacker00712-Feb-18 1:25
professionalSlacker00712-Feb-18 1:25 
GeneralRe: The usual b&tching Pin
gardnerp12-Feb-18 1:55
gardnerp12-Feb-18 1:55 
This is exactly how we code where I am employed. Take the default VS install options, and put the leading brace on the first line. Then change the default spaces from 4 to 3. Not sure how those two options became the two changes.
GeneralRe: The usual b&tching Pin
ZurdoDev12-Feb-18 2:11
professionalZurdoDev12-Feb-18 2:11 
GeneralRe: The usual b&tching Pin
W Balboos, GHB12-Feb-18 2:13
W Balboos, GHB12-Feb-18 2:13 
GeneralRe: The usual b&tching Pin
ZurdoDev12-Feb-18 2:16
professionalZurdoDev12-Feb-18 2:16 
GeneralRe: The usual b&tching Pin
W Balboos, GHB12-Feb-18 2:21
W Balboos, GHB12-Feb-18 2:21 
GeneralRe: The usual b&tching Pin
ZurdoDev12-Feb-18 2:31
professionalZurdoDev12-Feb-18 2:31 
GeneralRe: The usual b&tching Pin
W Balboos, GHB12-Feb-18 2:32
W Balboos, GHB12-Feb-18 2:32 
GeneralRe: The usual b&tching Pin
CodeWraith12-Feb-18 2:43
CodeWraith12-Feb-18 2:43 
GeneralRe: The usual b&tching Pin
W Balboos, GHB12-Feb-18 2:44
W Balboos, GHB12-Feb-18 2:44 
GeneralRe: The usual b&tching Pin
Chris Maunder12-Feb-18 9:39
cofounderChris Maunder12-Feb-18 9:39 
GeneralRe: The usual b&tching Pin
bryce12-Feb-18 17:59
bryce12-Feb-18 17:59 
GeneralRe: The usual b&tching Pin
W Balboos, GHB13-Feb-18 0:26
W Balboos, GHB13-Feb-18 0:26 
GeneralTo be extra confusing... Pin
Graham Breach11-Feb-18 22:55
Graham Breach11-Feb-18 22:55 
GeneralAlternative 3 Pin
Jonas Hammarberg11-Feb-18 21:44
professionalJonas Hammarberg11-Feb-18 21:44 
PraiseRe: Alternative 3 Pin
CPallini14-Feb-18 7:40
mveCPallini14-Feb-18 7:40 
GeneralOK, so I'm a pedant, but really... Pin
A_Griffin11-Feb-18 21:21
A_Griffin11-Feb-18 21:21 
GeneralRe: OK, so I'm a pedant, but really... Pin
Nathan Minier12-Feb-18 1:12
professionalNathan Minier12-Feb-18 1:12 
GeneralRe: OK, so I'm a pedant, but really... Pin
A_Griffin12-Feb-18 1:19
A_Griffin12-Feb-18 1:19 

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.