Hacker News new | ask | show | jobs
by jimbob45 1980 days ago
It can make code bloated and harder to follow.

TBH it would be nice if someone made C with indent scoping instead of block scoping but I don’t think that’s truly practical with the preprocessor.

2 comments

What's the practical difference between:

   if (foo)
      bar;
   else
      baz;
   
and:

   if (foo) {
      bar;
   } else {
      baz;
   }
The latter has one extra line, which is hardly bloat. It also has the braces, of course, but the upside of this style is that it's clear where the compound statement begins (it's the line that doesn't start with a brace!), and where it continues.
harder to follow? In what sense? Because in my book the fact that you can write both the line with braces and without make it much harder to think about, whereas in most other languages I don't need to think about it because there's only one way to write that.