Click here to Skip to main content
15,899,937 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: ALWAYS block markers and multiline Pin
MarkTJohnson12-Oct-21 1:50
professionalMarkTJohnson12-Oct-21 1:50 
GeneralRe: ALWAYS block markers and multiline Pin
Nelek13-Oct-21 4:37
protectorNelek13-Oct-21 4:37 
GeneralRe: ALWAYS block markers and multiline Pin
englebart12-Oct-21 4:35
professionalenglebart12-Oct-21 4:35 
GeneralRe: ALWAYS block markers and multiline Pin
adriancs17-Oct-21 1:32
mvaadriancs17-Oct-21 1:32 
GeneralNo markers, but using 2 lines Pin
Patrick Van Cauteren11-Oct-21 20:22
Patrick Van Cauteren11-Oct-21 20:22 
GeneralRe: No markers, but using 2 lines Pin
Nelek13-Oct-21 4:32
protectorNelek13-Oct-21 4:32 
GeneralRe: No markers, but using 2 lines Pin
Patrick Van Cauteren13-Oct-21 19:51
Patrick Van Cauteren13-Oct-21 19:51 
GeneralRe: No markers, but using 2 lines Pin
Nelek13-Oct-21 20:26
protectorNelek13-Oct-21 20:26 
Patrick Van Cauteren wrote:
Developers are (or should be) smart enough to realize that if they add a statement to the IF-block,
It has nothing to do with intelligence. One can be in stress, have a bad day, be tired and many other factors that might influence the probability of doing such an error.
M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.

GeneralI don't use languages Pin
PIEBALDconsult11-Oct-21 14:35
mvePIEBALDconsult11-Oct-21 14:35 
GeneralRe: I don't use languages Pin
Saša Ćetković12-Oct-21 6:01
professionalSaša Ćetković12-Oct-21 6:01 
GeneralRe: I don't use languages Pin
trønderen15-Oct-21 12:48
trønderen15-Oct-21 12:48 
GeneralVisual Studio 2019 ... Pin
Amarnath S11-Oct-21 14:31
professionalAmarnath S11-Oct-21 14:31 
GeneralRe: Visual Studio 2019 ... Pin
Greg Utas12-Oct-21 2:32
professionalGreg Utas12-Oct-21 2:32 
GeneralRe: Visual Studio 2019 ... Pin
trønderen15-Oct-21 12:50
trønderen15-Oct-21 12:50 
GeneralGenerally yes, but depends too Pin
Erik Burd11-Oct-21 7:55
professionalErik Burd11-Oct-21 7:55 
GeneralRe: Generally yes, but depends too Pin
Matias Lopez12-Oct-21 4:10
Matias Lopez12-Oct-21 4:10 
GeneralI always use block markers. Well ... Pin
OriginalGriff11-Oct-21 6:36
mveOriginalGriff11-Oct-21 6:36 
GeneralRe: I always use block markers. Well ... Pin
Nelek11-Oct-21 8:17
protectorNelek11-Oct-21 8:17 
PraiseRe: I always use block markers. Well ... Pin
den2k8811-Oct-21 20:47
professionalden2k8811-Oct-21 20:47 
GeneralRe: I always use block markers. Well ... Pin
Nagy Vilmos15-Oct-21 1:23
professionalNagy Vilmos15-Oct-21 1:23 
GeneralRe: I always use block markers. Well ... Pin
OriginalGriff15-Oct-21 1:34
mveOriginalGriff15-Oct-21 1:34 
GeneralRe: I always use block markers. Well ... Pin
trønderen15-Oct-21 13:13
trønderen15-Oct-21 13:13 
GeneralRe: I always use block markers. Well ... Pin
trønderen15-Oct-21 13:00
trønderen15-Oct-21 13:00 

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.