Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: