Robert N. Harris, Director of Information and Technology with Driven-Inc.
The Lair of Leaky Abstractions – Guidelines for the Care and Feeding of Software Developers
After building and leading software teams for 14 years, I’ve learned developers are fearsomely powerful wizards that sometimes fall victim to their own cleverness. I keep a list of hard-learned lessons on my whiteboard to help us avoid making the same mistakes over and over again. Here is a sample.
rule – if it can be null, it will be null
Gets us every time. Dev and test databases full of edge cases to cover every known bug and issue. Release to production databases full of empty tables supporting new features. My inbox runneth over with error reports. We were going to add tests for that later, but…
rule – later == never, temporary == forever
How many times have you seen a code comment like this? Or written one yourself?
//Temporary workaround. Come back and fix later
Look at the timestamp; it’s been running in production for years. Don’t despair. If it’s been working this long, it couldn’t have been that bad. And if we’re honest, all code is a temporary workaround because….
rule – tomorrow you hates the code you wrote today
Show any developer something they wrote over a year ago. “It’s garbage. I need to rewrite it.” Why? “It’s a mess. It needs to be refactored.” This is actually a very desirable trait; it means they kept learning since they wrote it. Developers who look at their old code and like it are the ones you have to keep an eye on. Seriously though, don’t let them rewrite it, but that’s a lesson for another day.