by ilek · 10y ago · 0 comments
if (a)
...
else ...
But for some reason I find the below _very_ frustrating. It feels misleading and I find it to be very, very ugly.if (a)
...
else { /* Multi line block */
}The else is executed if there is no error, in my style at least, so naturally it will contain more logic.
I've seen
if (a) thing;
but never with an else, and certainly never with an else that has a multi-line block. That's definitely somethign I'd call out in a CR.
I'd rather a compiler forces me to put braces around everything than let people have the opportunity to do something like the latter from my original comment.