Hacker News new | ask | show | jobs
by sauceop 2682 days ago
Consistency of code style does matter, up to a point, to people reading and understanding the code. As you suggest, setting up ground rules and tooling helps

Code authors who don't see the value in consistency of code are potentially a problem - if authors are submitting code reviews with hundreds of actual style issues, that's either a failure of process or the author to write readable code (not sure if that's what happened in your examples, to be clear).

1 comments

It could also be a testament of the reviewer's inability to read code written differently.

Style is not consistent across authors, codebases, projects, even companies. I had to learn to read code in many different styles.

Enforcing consistency can be done with formatters/linters. It doesn't need to come up in review.

It depends on how important you think it is to optimize for future readers or maintainers of the code. I weigh that pretty heavily and a do think relatively minor style issues impose a tax once they're pervasive in a codebase.

Tooling is great, but I think there are a lot of style issues that aren't readily enforceable with linters - commenting, naming, control flow, abstraction, etc.