Click here to Skip to main content
15,846,976 members

Survey Results

When coding, do you put braces around single nested statements?

Survey period: 27 Aug 2018 to 3 Sep 2018

When coding using a language with braces, that is.

OptionVotes% 
Yes, always47536.48
Yes, mostly27120.81
Depends on the situation25019.20
Not usually16612.75
Never785.99
I don't code using a language with braces624.76



 
GeneralNot usually Pin
Leng Vang30-Aug-18 9:51
Leng Vang30-Aug-18 9:51 
GeneralYou people don't know how to be Analy Retentive Pin
Mycroft Holmes29-Aug-18 14:03
professionalMycroft Holmes29-Aug-18 14:03 
GeneralRe: You people don't know how to be Analy Retentive Pin
CodeWraith30-Aug-18 0:02
CodeWraith30-Aug-18 0:02 
GeneralI don't, the beautifier does, as it is supposed to Pin
Franc Morales29-Aug-18 0:58
Franc Morales29-Aug-18 0:58 
GeneralRe: I don't, the beautifier does, as it is supposed to Pin
CodeWraith30-Aug-18 0:05
CodeWraith30-Aug-18 0:05 
GeneralHow is "Yes, mostly" that different from "It depends on the situation"? Pin
TNCaver28-Aug-18 7:46
TNCaver28-Aug-18 7:46 
GeneralRe: How is "Yes, mostly" that different from "It depends on the situation"? Pin
Sammuel Miranda29-Aug-18 10:04
professionalSammuel Miranda29-Aug-18 10:04 
GeneralRe: How is "Yes, mostly" that different from "It depends on the situation"? Pin
Jared Stroebele30-Aug-18 4:42
professionalJared Stroebele30-Aug-18 4:42 
GeneralOne line-it every time i can Pin
Sammuel Miranda28-Aug-18 7:43
professionalSammuel Miranda28-Aug-18 7:43 
GeneralRe: One line-it every time i can Pin
Richard Deeming29-Aug-18 5:05
mveRichard Deeming29-Aug-18 5:05 
GeneralRe: One line-it every time i can Pin
Sammuel Miranda29-Aug-18 9:55
professionalSammuel Miranda29-Aug-18 9:55 
GeneralRe: One line-it every time i can Pin
Kevin McFarlane30-Aug-18 2:16
Kevin McFarlane30-Aug-18 2:16 
GeneralRe: One line-it every time i can Pin
Sammuel Miranda4-Sep-18 6:17
professionalSammuel Miranda4-Sep-18 6:17 
GeneralBraces don't always help Pin
Marc Clifton28-Aug-18 3:09
mvaMarc Clifton28-Aug-18 3:09 
GeneralRe: Braces don't always help Pin
den2k8828-Aug-18 4:00
professionalden2k8828-Aug-18 4:00 
GeneralRe: Braces don't always help PinPopular
Mladen Janković28-Aug-18 4:31
Mladen Janković28-Aug-18 4:31 
GeneralRe: Braces don't always help Pin
Ravi Bhavnani1-Sep-18 12:48
professionalRavi Bhavnani1-Sep-18 12:48 
GeneralRe: Braces don't always help Pin
Daniel Wilianto7-Sep-18 17:33
Daniel Wilianto7-Sep-18 17:33 
GeneralRe: Braces don't always help Pin
TNCaver28-Aug-18 7:41
TNCaver28-Aug-18 7:41 
GeneralRe: Braces don't always help Pin
Daniel Wilianto7-Sep-18 17:35
Daniel Wilianto7-Sep-18 17:35 
GeneralBrace == indent Pin
kalberts28-Aug-18 2:30
kalberts28-Aug-18 2:30 
GeneralRe: Brace == indent Pin
Kewin Rausch29-Aug-18 2:57
professionalKewin Rausch29-Aug-18 2:57 
GeneralRe: Brace == indent Pin
kalberts30-Aug-18 2:59
kalberts30-Aug-18 2:59 
Young programmers today refuse to believe that some explicit delimiters are k&r artifacts. Before k&r C, you could write e.g. "if X = 5 then y := 3;". After all, in plain text, you never write things such as "if (it is cold outside) {wear a jacket}". But in the Pascal example, the young programmers gasp: But... how can you know where the condition ends, if it is not enclosed in parentheses?

Noone has ever claimed that K & R were language design gurus. C was never "designed" at all, it just grew out of now forgotten B and BCPL, features added as they were needed, not as a result of any "lets sit down and plan what we might need, and then design a mechanism for it". So here and there they experienced "ooops! unless we add delimiters, there will be an ambiguity!"

Ending up with an excessive number of delimiter which are required only because the compiler needs it, due to poor language design, is somewhat ironic considering that a lot of programmers praised c as so much nicer that Pascal, becase you could write "{ }" rather than "begin end", saving several keystrokes (and you didn't consume as much punched paper tape Smile | :) ).
GeneralRe: Brace == indent Pin
Kewin Rausch30-Aug-18 23:07
professionalKewin Rausch30-Aug-18 23:07 
GeneralRe: Brace == indent Pin
kalberts31-Aug-18 1:56
kalberts31-Aug-18 1:56 

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.