Hacker News new | ask | show | jobs
by vortico 2682 days ago
The only problem that would solve is braindead code like

    if (something)
      doThis();
      andThat();
which is absolutely absurd to pass even basic code review. Even most compilers (clang, GCC, etc.) will warn you about that.

What omitting curly braces after `if` statements does do is make code ~1% more readable, which can have massive cumulative positive results in security and stability with a multi-million line codebase.

2 comments

You say it's absurd, but many people will instinctively remember goto fail: https://www.imperialviolet.org/2014/02/22/applebug.html
clang does not have such a warning, though clang-tidy and GCC do:

https://bugs.llvm.org/show_bug.cgi?id=18938