In The Hungry Programmer Jesse Storimer writes about the small decisions we make on a regular basis and how the affect our health and our code. The analogy is a play on the concept of technical debt which I have been fascinated with lately. Technical debt is the idea that when you take shortcuts to ship code you are borrowing against the future. Future resources will be consumed fixing old issues rather than developing new features.
Every day “the business” places constraints on just how long development can go before shipping a feature or new version. This is good when if provides momentum but bad when it creates debt however in financial terms sometimes it makes sense to go into debt to accomplish a goal. Imagine if you couldn’t buy a house until you had all the cash up front to pay for it, or you missed the sale on that new car because you were short a $100, in these cases debt is a tool. In foodie terms sometimes it’s just more realistic to eat at takeout than take the family to the new gastropub with locally sources grassfed beef. These practices are not bad but they are unsustainable – so the question is how do you measure the cost of the “interest” you’re paying, how do you know when your code is “fat” and about to suffer a heart attack?
Well like a real diet you have to start measuring. About two years ago I went on a diet and lost 50lbs so the analogy is fresh for me. On that diet I measured two things: overall weight and percentage of body fat. Progress was slow at first but by about 30 days I started to see some limited progress and then rapidly my body learned a new pattern and by 60 days I was loosing 10lbs a month. Because I could see my progress each day I had real-time feedback on the positive or negative impact my previous day’s choices had and this further entrenched positive choices.
So let’s take this back to programming. We need a scale and some consensus on what healthy looks like. First off you must know where your time is going. It’s against the software engineering ethos if you cannot account for where your time is going you cannot hope to understand the cost of poor code. Even simple measurements like a daily break down of time on new features v.s. bug fixes and firefighting can provide the basis for understanding just what that last half ready release cost and continues to cost going forward. The more granular you can get (within reason) the more insight you can provide and the more convincing your argument to non-technical counterparts.
Most of the environments have typically been about 50/50 in terms of new development v.s. bugs. I don’t know if this is particularly healthy (I rather think not). How about you – what do you think healthy code looks like?