Tuesday, December 1, 2009

If you're the CTO in a newly-founded startup...

Short version:

If you're the CTO in a newly-founded software-based startup, please read about technical debt and know these estimates:
  • If you don't code unit tests and hardly ever refactor, you're probably accruing technical debt as fast as 2, or even 3 man·days of debt per man·day of work.
  • The interest rate on this kind of debt is easily in the range of 7% ... monthly!
Long version:

My last three jobs have had many aspects in common, including web applications with low maintainability, a.k.a. legacy code. I could even say that I make a living out of legacy code: it's not until those companies realize that their development is dismayingly slow that they get ready to shell out a salary like mine to improve the situation.

How is it possible that young companies like those have already managed to entangle themselves in legacy code? In the most extreme case, the product was less than one year old when I joined and it was already exhibiting serious maintainability problems.

A start-up environment is specially prone to generating legacy code: start-ups hire (or are founded by) programmers with little or no experience; there is a strong sense of urgency pervading the culture (or else they won't survive long enough to hire me, so I'll never know about them); and, even if they know they are incurring in technical debt, that's not seen as a big problem in comparison to the financial debt problem.

So, if you're the CTO/CEO in a newly-founded startup, you can choose to do the same: hire inexperienced programmers, put them under schedule pressure, and accumulate technical debt. That's a proven good path: those three companies I mentioned earlier have been successful enough by following it. Futhermore, it's a path which enlarges my job market, for which I will thank you profusely.

My recommendation, however, is to carefully avoid technical debt -- or at least the kinds Uncle Bob calls "mess", or Steve McConnell classifies as "first kind". Why? Because the interest on technical debt can easily run as high as 7% monthly. What would you tell your CFO if he used a credit line at 125% yearly interest?

(How did I get to this figure? I did a quick & dirty estimation from just a few personal observations: that writing new code without any attention to maintainability can easily be 3 times as fast as with; that after about 12 man·months of doing that, development slows to a crawl and the company has to hire more people just to keep moving. Keep the metaphor and do the math: roughly 7% a month will bring your 300% productivity down to 50% in 12 [man·]months.)


Doing without automated testing is one specific kind of technical debt which each of those three companies incurred into, and which is tremendously onerous to pay back -- so I'm warning you against it specifically: please make sure at least a few in your development team are familiar with automated testing, and that they are given enough slack -- specially in the first few weeks of the project -- to put this knowledge to use. You'll get a better quality product and you'll avoid finding yourself in a predicament just a few months down the road.

1 comment:

  1. Very nice description of the costs of not properly tending to the long-term health of the code. Well done!

    ReplyDelete