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



 
GeneralRe: I program in C, C++, and C# and always use block markers Pin
peterkm17-Oct-21 10:18
professionalpeterkm17-Oct-21 10:18 
GeneralMISRA C Pin
den2k8811-Oct-21 21:46
professionalden2k8811-Oct-21 21:46 
GeneralRe: MISRA C Pin
trønderen15-Oct-21 13:45
trønderen15-Oct-21 13:45 
GeneralALWAYS block markers and multiline PinPopular
KarstenK11-Oct-21 21:29
mveKarstenK11-Oct-21 21:29 
GeneralRe: ALWAYS block markers and multiline Pin
MarkTJohnson12-Oct-21 2:50
professionalMarkTJohnson12-Oct-21 2:50 
GeneralRe: ALWAYS block markers and multiline Pin
Nelek13-Oct-21 5:37
protectorNelek13-Oct-21 5:37 
GeneralRe: ALWAYS block markers and multiline Pin
englebart12-Oct-21 5:35
professionalenglebart12-Oct-21 5:35 
GeneralRe: ALWAYS block markers and multiline Pin
adriancs17-Oct-21 2:32
professionaladriancs17-Oct-21 2:32 
Yupe, totally agree. More human readable, easy for maintenance, less bug.
GeneralNo markers, but using 2 lines Pin
Patrick Van Cauteren11-Oct-21 21:22
Patrick Van Cauteren11-Oct-21 21:22 
GeneralRe: No markers, but using 2 lines Pin
Nelek13-Oct-21 5:32
protectorNelek13-Oct-21 5:32 
GeneralRe: No markers, but using 2 lines Pin
Patrick Van Cauteren13-Oct-21 20:51
Patrick Van Cauteren13-Oct-21 20:51 
GeneralRe: No markers, but using 2 lines Pin
Nelek13-Oct-21 21:26
protectorNelek13-Oct-21 21:26 
GeneralI don't use languages Pin
PIEBALDconsult11-Oct-21 15:35
professionalPIEBALDconsult11-Oct-21 15:35 
GeneralRe: I don't use languages Pin
Saša Ćetković12-Oct-21 7:01
professionalSaša Ćetković12-Oct-21 7:01 
GeneralRe: I don't use languages Pin
trønderen15-Oct-21 13:48
trønderen15-Oct-21 13:48 
GeneralVisual Studio 2019 ... Pin
Amarnath S11-Oct-21 15:31
professionalAmarnath S11-Oct-21 15:31 
GeneralRe: Visual Studio 2019 ... Pin
Greg Utas12-Oct-21 3:32
mveGreg Utas12-Oct-21 3:32 
GeneralRe: Visual Studio 2019 ... Pin
trønderen15-Oct-21 13:50
trønderen15-Oct-21 13:50 
GeneralGenerally yes, but depends too Pin
Erik Burd11-Oct-21 8:55
professionalErik Burd11-Oct-21 8:55 
GeneralRe: Generally yes, but depends too Pin
Matias Lopez12-Oct-21 5:10
Matias Lopez12-Oct-21 5:10 
GeneralI always use block markers. Well ... Pin
OriginalGriff11-Oct-21 7:36
mvaOriginalGriff11-Oct-21 7:36 
GeneralRe: I always use block markers. Well ... Pin
Nelek11-Oct-21 9:17
protectorNelek11-Oct-21 9:17 
PraiseRe: I always use block markers. Well ... Pin
den2k8811-Oct-21 21:47
professionalden2k8811-Oct-21 21:47 
GeneralRe: I always use block markers. Well ... Pin
Nagy Vilmos15-Oct-21 2:23
professionalNagy Vilmos15-Oct-21 2:23 
GeneralRe: I always use block markers. Well ... Pin
OriginalGriff15-Oct-21 2:34
mvaOriginalGriff15-Oct-21 2:34 

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.