On Mon, Jan 2, 2012 at 4:22 PM, Ron Adam <ron3200 at gmail.com> wrote: > The problem is only when an additional statement is added to the last > block, not the preceding ones, as the compiler will complain about > those. So I don't know how the 4 line example without braces is any > worse than a 2 line if without braces. Even when the compiler picks it up, it's still a wasted edit-compile cycle. More importantly though, this approach makes the rules too complicated. "Always use braces" is simple and easy, and the only cost is the extra line of vertical whitespace for the closing brace. (I personally don't like even the exception made for single clause if statements, but that's already too prevalent in the code base to do anything about. Hence the 4-line example in my original post.) Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4