Why do we want to format statements that way, but function calls and expressions a different way? No one would write this:
if (shouldDoThings) {doOneThing();
doAnotherThing();
doLastThing();}
I have a theory about that but will have to save it for another day.
Somewhat related, the Rust coding style guidelines used to follow a heavily column-aligned style, but changed to indentation-only a year or two ago. I posted an example from the Servo source code with the old and new formats here:
More food for thought:
The style in your example is more consistent with the way nearly every programmer formats code that has more than one statement. For example:
Why do we want to format statements that way, but function calls and expressions a different way? No one would write this: I have a theory about that but will have to save it for another day.Somewhat related, the Rust coding style guidelines used to follow a heavily column-aligned style, but changed to indentation-only a year or two ago. I posted an example from the Servo source code with the old and new formats here:
https://news.ycombinator.com/item?id=18962177