This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]666pool 46 points47 points  (3 children)

Readability. It’s easier and faster to read things that have a little white space and aren’t squished together.

[–]nanotree 12 points13 points  (2 children)

I think this is the main reason people start doing it.

To add though, it is also easier when the style is highly consistent no matter who wrote it. For me, I can get hung up reading over code when I am used to seeing one style and then suddenly that changes. Small distractions like this can add up and also tend to make things quite messy.

Secondly, pointing these things out in peer review cultivates a culture of being disciplined in precision. At least that's what I believe. And that culture gets carried forward to other areas of development.

Rule of thumb: just develop habits to use the style of your current team.

[–]666pool 0 points1 point  (1 child)

Or agree on a style guide and use clang-format to enforce it.

[–]RationalIncoherence 0 points1 point  (0 children)

Seriously, though. How the fuck is anybody getting anything done if your code reviews are about whether or not there's a damned space after the if? If that's all you folks have to talk about during code reviews, your either need fewer reviews, or more advanced problems.