Tuesday, February 25, 2014

If it's worth fixing, fix it!


Imagine the door handle on your front door is broken. Most of the time it falls off in your hand when you try to open the door. If you concentrate, you can hold the handle in place, and get the door open, but it's slow, fiddly and annoying, and visitors always have difficulty and end up really annoyed with your front door. So one day, you decide you're going to fix it. You've got visitors coming on the weekend and you are embarrassed by your broken front door. 
So you get started,  you loosen the whole handle and disconnect it. 

Then, with the door handle it pieces, you realise that from the front of your house, it's very easy to simply walk down the side and enter via the side door. In fact, it's better because that way, you can see from outside whether anyone is home, and you enter the house, right into the main living room, which is where you (or your guests) are usually going anyway.  Really, it just needs a path down the side of the house to make it a bit more "user friendly". Add that path, and you and your guests will never use the front door.

So, you rush out and buy some paving stones, and pave a beautiful pathway down the side leading to your sliding door. You even add a "Welcome" door mat for good measure. Your guests arrive and are led straight down the side of your house. All weekend, you're in and out via your sliding side door, up and down the path.... brilliant!

Then, an interesting thing happens. You order Pizza for dinner one night. Half an hour later, there's a knock at the door.... the front door. You wander down and to your surprise (and embarrassment) there lies the front door handle, still in pieces, now completely non-operational. You call out through the door, trying to explain to the pizza guy, that the door doesn't work, and he needs to make his way, in the dark, around the side, to your sliding side door. He trips (in the dark) drops the pizza and leaves in disgust - most likely to sue you for the medical bills incurred when he sprained his ankle, and burnt his arm on the hot melted cheese from your pizza. (That's right, the pizza was actually still hot!)

This sort of thing happens a lot when maintaining legacy computer code too. A problem is identified. A solution might be started. Then, someone notices a better way - a way that if only the users could see, would avoid the mess in the first place - mostly. Most of the time, if they did things this other way, they wouldn't even need this bug fixed in the first place. 

The temptation (especially if the "other way" is easier to code) is to jump in and code away. Now, if you've started with the fix, stop right there!  Document the new idea by all means. But always fix that initial bug. If it's broken, and it's worth your time to fix, fix it properly. Then, go right ahead and do the second thing as well, but "don't leave broken door handles lying around, just because you think there's a better way to get into the house."

=========

Having written and just re-read this, I'm struck by some overlap with the broken windows theory, which I am a subscriber too, but was far from my mind when I started dumping this thought from my mind...