Coding Standards – Why Does Uncle Bob Suggest Not Writing Down Coding Standards?

coding-standardsdevelopment-process

While I was reading this question, the top voted answer quoted Uncle Bob on coding standards, but I was confused by this tip:

  1. Don't write them down if you can avoid it. Rather, let the code be the way the standards are captured.

This bounced in my brain, but I couldn't find a place to stick. If a new person joins the team, or coding standards change, couldn't there be confusion of information?

Why shouldn't I write down a coding standard?

Best Answer

There are a few reasons.

  1. Nobody reads documentation.
  2. Nobody follows the documentation even if they do read it.
  3. Nobody updates the documentation even if they do read it and follow it.
  4. Writing a list of practices is much less effective than creating a culture.

Coding standards are not about what people should do, but are about what they actually do. When people deviate from the standards, this should be picked up and changed through a code review process and/or automated tools.

Remember, the whole point of coding standards is to make our lives easier. They're a shortcut for our brain so that we can filter out the necessary stuff from the important stuff. It's much better to create a culture of review to enforce this than it is to formalise it in a document.