in 99 words
In team software development, we create a collective work that is greater than any individual could create on his own. Arguing about style gets in the way.
When creating a coding standard, your most important achievement will be learning how to disagree constructively. To succeed, create the minimal set of standards you can live with. Focus on consistency and consensus over perfection. Remember that few decisions are irrevocable in agile development.
Assume your colleagues are professional and well-meaning. If they deviate from the standard, discuss reasons rather than placing blame. No coding standard can substitute for professional judgement.
as haiku
Fists fly, dust billows--
Tomatoes die, peas cry, as
we choose rose's hue.
Inside This Section
- Coding Standards
- Beyond Formatting
- How to Create a Coding Standard
- Dealing with Disagreement
- Adhering to the Standard
- Questions
- We have legacy code that doesn't fit our standard. Should we fix it?
- Results
- Contraindications
- Alternatives
Rant
Sometimes it's hard to figure out what to write in these weekly updates. Coding standards--what can I say about coding standards that we didn't already say in the book? Oh, I know. In the immortal words of William Shatner...

People get really worked up over coding standards. I mean really worked up. But they're actually not that important. The choices are more style than substance. I like exceptions; you like error codes. I like camelCase; you like words_with_underscores. It's programmers' equivalent of the fashion industry: different styles evoke disgust; the thought of having to actually use that style generates outright loathing.
If you're one of those people, it's time to get over yourself. It's good to be consistent, sure. But it doesn't matter which consistent you choose. Just pick one already. And if you're constantly arguing about coding standards, here's a sure-fire way to win the arguments: give in.
That's right--give in. Either you're right, and the other guy's standard will lead to pain and suffering, in which case you'll be vindicated, everybody will agree to follow your coding standard, and you'll get to say "I told you so"...
Or it won't really matter, nothing bad will happen, in which case you've won because people will stop thinking of you as that jerk who always argues about coding standards.
Either way, it's a net positive.

Subscribe (RSS)
Print

Loading comments...