I was catching up on my blog reading (ObjectMentor to be more specific) when I found Uncle Bob's post on quintessence as the fifth element for the Agile Manifesto. His statement of “Craftsmanship over Crap” really rang true with me.
We (software developers) like to compare our work to that of craftsmen and many people are starting to realize that maintainability is one of the cornerstones of writing good software. However, our software still keeps decaying, brilliant designs are mangled with hacks, quick bug fixes or just plain outdated with changing requirements.
However, I challenge you, next time you go to fix that bug or that small change request that almost fits the current design, step back and think first. Spend those extra minutes considering if there is a way you can fix it, maybe even improving the current design. Don‘t go on an overengineering spree, just keep it simple and elegant. Then, when you’re done, sit back and marvel at your work and smile.
We've all made a quick hack, we will all do it again, but I promise you, those few extra minutes spent will be worth it in the long run. Technical debt has high interests. How often have you made a quick change while thinking (or even better made a comment) that you will come back and fix it later. How often have you forgotten?
Actively thinking about this and being proud of the results is really good for my personal productivity. Ideally, if you always leave your code slightly better than you found it, it should resist decay very well. Challenge your team to join you in this quest.
- Leave the code slightly better than you found it.
- Write a regression test for a bug, so it's not reintroduced.
- Don't live in a house with broken windows.
- Write tests to gain the confidence to perform refactoring.
- Be a craftsman.
And to quote J.P Boodhoo: 'Develop with Passion'.