Hacker News new | ask | show | jobs
by kevin_thibedeau 1982 days ago
They add visual noise. The grammar of C is not the same as the grammar of it's offshoots and block statements aren't part of control structures. Moreover, GCC warns about extra statements with the same indentation level with -Wall on.
4 comments

>They add visual noise.

Which is a good thing, since it prevents errors such as this one. Extra verbosity with mandatory braces is noise (to the degree that without it, the compiler could still infer what we mean), but some degree of verbosity is a good thing, as it helps make patterns in the code more evident.

In which case we might want to call it a more fitting error than the dismissing "noise".

How about "dither"?

IMO you get accustomed to single statement-braces very quick and they leave less room for errors.
That is probably why styles like

  if (cond) {
    // statement
  } else {
    // statement
  }

existed. Allow you to quote everything while not waste so much vertical space.
and remove bugs