Click here to Skip to main content
15,067,539 members

Survey Results

Do you use block markers (eg. {}, begin/end) when the code block is only a single line?

Survey period: 11 Oct 2021 to 18 Oct 2021

Consistency or compactness? What's your preferred way of marking blocks of code?

OptionVotes% 
I always wrap code blocks in block markers regardless of the number of lines in the block
if (condition) { statement; }
49152.97
I only use block markers when there is more than 1 line
if (condition) statement;
22223.95
The programming language I use requires I always use block markers131.40
I don't program in a language that uses block markers464.96
It depends (on my mood, my team mates, the current project, the language, the phase of the moon...)15516.72



 
GeneralUsed to "any", but now "Always" Pin
adriancs17-Oct-21 1:42
professionaladriancs17-Oct-21 1:42 
GeneralSelf Interest Pin
Patrick Wimberly13-Oct-21 4:21
MemberPatrick Wimberly13-Oct-21 4:21 
GeneralClarity always counts PinPopular
YrthWyndAndFyre13-Oct-21 3:19
MemberYrthWyndAndFyre13-Oct-21 3:19 
GeneralNo (usually). Pin
Jon McKee12-Oct-21 20:32
professionalJon McKee12-Oct-21 20:32 
GeneralDepends Pin
Julian Ragan12-Oct-21 11:30
MemberJulian Ragan12-Oct-21 11:30 
GeneralAlways Pin
obermd12-Oct-21 9:36
Memberobermd12-Oct-21 9:36 
QuestionFor folks who selected "I don't program in a language that uses block markers" Pin
Vikram A Punathambekar12-Oct-21 6:58
MemberVikram A Punathambekar12-Oct-21 6:58 
AnswerRe: For folks who selected "I don't program in a language that uses block markers" Pin
Nagy Vilmos15-Oct-21 1:19
professionalNagy Vilmos15-Oct-21 1:19 
AnswerRe: For folks who selected "I don't program in a language that uses block markers" Pin
trønderen15-Oct-21 12:38
Membertrønderen15-Oct-21 12:38 
GeneralAlmost always Pin
sasadler12-Oct-21 6:08
Membersasadler12-Oct-21 6:08 
GeneralThis sounds like an interview question! Pin
AndyChisholm12-Oct-21 4:58
MemberAndyChisholm12-Oct-21 4:58 
GeneralI put them in; CodeMaid takes them out! Pin
StarNamer_12-Oct-21 4:41
professionalStarNamer_12-Oct-21 4:41 
GeneralRe: I put them in; CodeMaid takes them out! Pin
Paul Sanders (the other one)12-Oct-21 7:45
MemberPaul Sanders (the other one)12-Oct-21 7:45 
GeneralRe: I put them in; CodeMaid takes them out! Pin
StarNamer_12-Oct-21 12:32
professionalStarNamer_12-Oct-21 12:32 
GeneralNo Python then Pin
Bruce Patin12-Oct-21 3:51
MemberBruce Patin12-Oct-21 3:51 
GeneralMy preference mostly depends on the language/coding style Pin
Dan Neely12-Oct-21 3:38
MemberDan Neely12-Oct-21 3:38 
GeneralOnly for work... Pin
decaffeinatedMonkey12-Oct-21 3:34
MemberdecaffeinatedMonkey12-Oct-21 3:34 
GeneralI program in C, C++, and C# and always use block markers Pin
Daniel Pfeffer11-Oct-21 22:15
professionalDaniel Pfeffer11-Oct-21 22:15 
GeneralRe: I program in C, C++, and C# and always use block markers Pin
Stuart Dootson12-Oct-21 5:18
professionalStuart Dootson12-Oct-21 5:18 
GeneralRe: I program in C, C++, and C# and always use block markers Pin
Greg Utas13-Oct-21 2:23
mvaGreg Utas13-Oct-21 2:23 
GeneralRe: I program in C, C++, and C# and always use block markers Pin
Nelek13-Oct-21 4:39
protectorNelek13-Oct-21 4:39 
GeneralRe: I program in C, C++, and C# and always use block markers Pin
TX643017-Oct-21 9:18
MemberTX643017-Oct-21 9:18 
GeneralMISRA C Pin
den2k8811-Oct-21 20:46
professionalden2k8811-Oct-21 20:46 
GeneralRe: MISRA C Pin
trønderen15-Oct-21 12:45
Membertrønderen15-Oct-21 12:45 
GeneralALWAYS block markers and multiline PinPopular
KarstenK11-Oct-21 20:29
mveKarstenK11-Oct-21 20:29 

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.