Tuesday, 10 July 2012

Rules vs Principles

I often hear people talking about rules in software development. The trouble with rules is that it is considered wrong to break them under any circumstance, even if common sense dictates otherwise. Rules can be useful when you are new to a subject and don't understand its principles but it doesn't make sense to follow them blindly when you do, or expect other people to do the same.

In places where I see rules enforced it's often because someone in authority needs to feel in control. They want all code to be formatted consistently, or everyone to operate under a clear desk policy. Now don't misunderstand me - I would love it if everyone wrote code that conformed to my own subjective preferences, but it's far more important to me that developers are free to express themselves, and providing the code they write is "clean" I can cope with a mixture of styles.

I've blogged before about how self direction is an important ingredient for intrinsic motivation. While I can see there's cost and risk associated with this (especially when people aren't as capable as they think they are), allowing others the freedom to make mistakes is a powerful learning tool that can both advance an individual's capability and teach them humility. There are other techniques that can help mitigate the risk and costs - pair programming is one, test driven development is another.

My final gripe against rules is that you can end up spending a great deal of time enforcing them, and doing so always feels like inflicting punishment. Good people don't want to come to work to be punished, they want to be creative and to feel proud of what they produce. So tear up that rule book, try being guided by principles instead.

1 comment:

dalibor-novak said...

Sounds like you are making an excellent case for shu-ha-ri. http://alistair.cockburn.us/Shu+Ha+Ri

Post a Comment