How to win friends with Maintenance Driven Design
Posted 4 April 2012 @ 6pm Tagged code, thoughts Comments: Be the first!
When I come to a design decision in writing an application, script, or interface. I ask myself only one question: What will the next guy think? I call this Maintenance Driven Design. By designing your software to be maintainable, you will earn many friends and praises.
As software developers, ops guys, designers, it is a known evil that we sometimes choose shortcuts, accruing tech debt with the knowledge that we’ll pay for it later with considerable interest. However, there are a few categories of design choices that we make every day that will make software easier or harder to maintain for the next guy who comes after us, which are specifically evil and malicious forms of tech debt.
Here are a few basic categories that most non-Maintenance Driven decisions fall into. Please don’t be that guy :)
- duplication – This is the cardinal sin against Maintainable Design. If you duplicate code, it will instantly grow into piles of subtly divergent crap. It would have taken you an additional hour to figure out how to do it in a non-duplicated way. It will take your maintainers half a lifetime to understand why and how the code has diverged. My own anecdotal experience says that duplication has about a 1000% tech debt interest rate. That is, 1 hour saved by committing duplicated code will cost you 10 hours down the line. And this interest is compounded over time as the code diverges further.
- clever code – Clever is the enemy of Maintainable. Every time you cut and paste a really cool hack that you found on a blog in 2006, a unicorn dies. Follow conventions, and use existing and accepted practices instead of reinventing the wheel.
- personal aesthetics – Having a strong sense of personal style is awesome. You like snakeskin jackets and neon green pants? Sweet. But leave it out of the code. If you have a personal style that goes against accepted conventions, and you choose to prioritize your style over that of the community, you are not Maintenance Driven. When in doubt, look at the source code for a large community supported project (i.e. Rails) for style ideas.
- poor naming – Single letter variable names are impossible to grep for effectively. Names based on your favorite ninja turtles, though they will win you points with me, are bad for business. Same goes for commit messages – don’t write something clever and witty at the expense of clearly explaining your changes.

