Today on Controversial Saturday:
Curly braces!

In languages acceping both, which is better?

No braces:

if (condition)
do_this();

OR yes braces:

if (condition) {
do_this();
}

#programming #coding #c #cpp #style

Honestly, I just want to hear a good argument to skip the braces.

To me, braces don't look much less readable and it's a lot easier to add statements.

Plus, #security bugs: dwheeler.com/essays/apple-goto

Show thread
Follow

@dcz Anyone focusing on 3GL level issues in that code is probably way off base anyway, but gotos are horrendously evil disguisers of bad structure in 3GL code.
All code should go back to BEGIN and END statements. :-p

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml