3 ms·
I'm triggered by the lack of brackets after every if-expression. Sure it looks nicer this way but the default Visual Studio code style settings will complain if
by pelorat 4y ago
I'm triggered by the lack of brackets after every if-expression. Sure it looks nicer this way but the default Visual Studio code style settings will complain if you don't do it, hence I'm used to it.
- lucumo 4y agoI've started to remove them from my own code. It's widely mentioned as The Right Way, but I feel the reasons why are obsolete. The stated reason is always that you could forget to add braces when adding a second statement. That was useful in a time where a text editor was "smart" when it copied your indentation to a new line. But nowadays any tooling will warn you when indentation doesn't match the bracing. The odds of people making that mistake has gone so far down, that the risk is no longer worth the reduced readability.
- googlryas 4y agoYou don't know what tooling anyone editing your code is using though.
- Thiez 4y agoIf you enforce correct formatting before commits or in your CI builds that is no longer a problem.
- kwhitefoot 4y agoThat's a big if though.