Hacker News new | past | comments | ask | show | jobs | submit login

That would really start to hurt readability. There are plenty of instances where the body is very similar save for a small change, and having it lined up in a grid makes it much easier to read. As a contrived example, you can look straight down to see the action values here:

if(condition_1) { action(318); }

if(condition_2) { action(219); }

if(condition_3) { action(142); }

In my opinion, the bigger risk is having a single-statement if have its payload on the next line.

if(x.open()) x.close(); //very difficult to add another statement accidentally here

if(x.open())

    x.close();  //much easier to do so here
But of course I wouldn't want to start treating whitespace as special in C.



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

Search: