News for hackers. Stuff that matters.
Re:Linux kernel coding style by byllgrim on Tuesday March 28, 2017 @02:39AM (#13974587)
I don't get what "what looks like an `if` block" is. In a no-brace if, the statement that follows is indented. The next line after that is not indented. So the indented statement obviously belong to the if.
Re:Linux kernel coding style by nolemurs on Wednesday March 29, 2017 @09:43AM (#13986104)
The issue that comes up is when you go to add a line to that 'block' it's easy not to notice that it's not actually a block, just a single statement. Then you add another indented line, and now you've got something that looks a lot like a block, but isn't at all!

Of course, as others have pointed out, with some sort of reasonable linting setup or with compiler warnings, you'll probably catch the bug (unless macros are involved), but even so, I feel having something that looks like a block but isn't, adds cognitive load for little benefit.

Re:Linux kernel coding style by IE6 on Thursday March 30, 2017 @12:53AM (#13993014)
This works well in languages where whitespace matters