3 ms·
The challenge with style guides as an approach to "nice code" is they often focus on the code equivalent of writing a grammatically correct line of code -- thin
by jowiar 10y ago
The challenge with style guides as an approach to "nice code" is they often focus on the code equivalent of writing a grammatically correct line of code -- things that can be often caught with a linter.
Where I see things fail a lot more is in the code equivalent of "How do I structure a paragraph" or "How do I organize this paper", which most things under the "style guide" umbrella don't cover.
- sidlls 10y agoI've always thought of the "how to write grammatically correct code" style guides as being relevant to writing high quality code in the context of a team that may onboard a new person or an internal transfer: they provide some baseline guarantee (insofar as the team honors them, of course) of the structure and formatting of the code. This reduces some amount of friction in a team. The benefits provided are largely context dependent (e.g. they'll benefit teams that expect to have a couple of senior engineers and many juniors on a relatively constant basis more than a team of experienced engineers in general), but I think having a style guide is important for any "large enough" engineering organization. I've also always insisted on including at least some loose guides to cover the "how do I structure a paragraph" cases. These generally are going to vary on a project by project basis, though, so they're going to be more vague as a rule.