On Software Technical Debt

What is technical debt?

Some examples of technical debt are:

  • Code that has error scenarios and will fail in certain scenarios in a way that is undesireable.
  • Code that doesn't perform as well as desired or (like above) performs well for some percentage of use cases, but other degenerate cases will not work as well as desired.
  • Software written in a way that requires undesireable manual workarounds or processes.
  • Software that is difficult to read, is undocumented, or otherwise makes maintenance more difficult that necessary.

Why does it happen?

In my experience, good developer incur technical debt in order to achieve some other business objective that has higher value than the debt incurred. For example...if I spend 5 minutes to write some hacky/difficult to read code that fails 1 out 100 times, but that enables my business to reap thousands of dollars of revenue, I might be inclined to "just do it". Of course, in my oh so humble opinion, I have the tools (experience, value mindset...whatever) to make these decisions and/or have an objective discussion around "should I spend 3 weeks writing the perfect solution...or spend 5 minutes writing a hacky workaround that I will have to rewrite 10 times to get "right"?

In addition to that reason, there is the "it's new, I'm inexperienced with the problem space, I don't know the programming language, ... "fill in the blank" reason that can cause it too. As an example, I know little to nothing about the Go programming language...but there is a specific thing I need to do (with some minor customization) that is relatively easy in "go". So I can implement this in 10 minutes, not realizing that I will overspend in the future with days or weeks of "something went wrong that I don't 100% understand.

How can you avoid it?

The way many many many folks avoid this problem is to slow down and only use tools they are very familiar with. As an example, many shops will "standardize" on a language/framework/saas tool in an effort to economise on "number of ways things can go wrong" but then they lose the opportunity to use a language/framework/tool that solves a particular problem in a much more economical way. This is usually done under the mantle of "standards" and "best practices" but it is usually only a crutch for newcomers to get familiar with the patterns already in use.

When is it good?

Going back to "Why does it happen?", it's good when you can reason about the leverage you gain from incurring the debt. Thinking in financial terms, many folks are totally OK taking on a mortgage for a place to live now, versus living in a cardboard box for 20 years so they can purchase thier very own home at that point. In the same token, taking on some debt now to solve an immediate problem is almost always a good idea. The rub is, however, you need to know the "interest rate" on that debt. Using the "home" metaphor, getting a mortgage on a house now that has a 50% APR, might not be a good idea (unless you're flipping and can make that back) and the same applies for code. If you're spending all your time servicing your debt, it's time to pay it down...if you're gaining leverage from your debt, you can pay it down if you want...but your money might better be spent elsewhere.

Comments

Popular posts from this blog

Push versus pull deployment models

the myth of asynchronous JDBC

Installing virtualbox guest additions on Centos 7 minimal image