3 ms·
Of course, you can omit the braces if there’s a single statement (though I personally never do this).
by saagarjha 7y ago
Of course, you can omit the braces if there’s a single statement (though I personally never do this).
- gpm 7y agoSure, and you can put the else on the same line as the end of the if block even without doing that. Or you could make the difference bigger by putting the opening brace on a newline. I wrote the style of C that I actually write, but it's probably not fair for me to label it as a property of just the language.
- saagarjha 7y agoI think it’s a fair point to bring up given that many people actually do write their code that way.