All posts

Common questions

What is technical debt? Meaning, examples and how to manage it

What technical debt means, with a simple example. Why it slows new work, when a little is fine, and what to ask your developer to keep it in check.

Published

The same shipping calculation in three screens: cart, checkout and order confirmation. Two updated, one missed

Your developer says, "There's some technical debt here, so this feature will take longer." What does that actually mean? Nobody has borrowed money. Here's what technical debt is, why it's called debt, and what to ask so it doesn't pile up.

The short answer

Technical debt is tidy-up work that was put off to build something faster. The website or app works, but the code inside isn't as clean as it should be, so changing it or adding to it is harder than it would ideally be. Martin Fowler describes it as "deficiencies in internal quality that make it harder than it would ideally be to modify and extend the system further" (Martin Fowler: Technical Debt). The metaphor was first used by developer Ward Cunningham in a 1992 report (OOPSLA '92).

A technical debt example: copied code

A common example is copying the same code into several places. Say an online store works out shipping in three places: the cart, the checkout and the order confirmation. Pasting the same shipping code into all three is quicker than building it once and sharing it.

Then the shipping rules change. Now someone has to update all three, and if they miss one, customers see a different shipping price on different screens. The code still works, but every change costs extra effort. That's technical debt.

Copied code is only one kind. Anything that makes the system harder to change counts, like the confusing structure Fowler uses as his example.

Why is it called debt?

Because the metaphor makes a hidden cost visible. Fowler calls the extra effort it takes to add new features the interest on the debt, and cleaning up the code paying off the principal (Martin Fowler: Technical Debt). Cunningham put it this way: "Every minute spent on not-quite-right code counts as interest on that debt." He also warned that whole engineering teams can grind to a halt under debt that's never repaid (OOPSLA '92).

Fowler says the metaphor is "very handy for communicating to non-technical people" (Technical Debt Quadrant). So it's a useful word to share when you and your developer talk about timelines.

Is technical debt always bad?

No. Cunningham wrote that "a little debt speeds development so long as it is paid back promptly". The danger comes when it isn't repaid (OOPSLA '92). Fowler sorts technical debt along two lines (Technical Debt Quadrant):

  • Prudent or reckless. Was it a considered trade-off to hit a release, or the result of rushing and cutting corners?
  • Deliberate or inadvertent. Did the team choose to put the work off, or only see the better design after building it?

Fowler argues that some debt is inevitable, even for excellent teams, because you learn as you build. That's why he says the useful question isn't whether there's debt, but whether it's prudent or reckless.

How to manage technical debt: a little at a time

Developers call the clean-up refactoring: changing the internal structure of the code without changing what it does from the outside (Refactoring.com). In the example above, that means moving the three copies of the shipping code into one place. Customers see exactly the same screens.

Fowler's advice on managing it (Martin Fowler: Technical Debt):

  • Pay it down gradually. You don't have to clear it all at once. Tidy up a bit each time you work on that part of the code.
  • Start where the code changes most. You only pay the interest when you touch that code. Messy but stable areas can be left alone, while busy areas shouldn't be allowed to build up debt.
  • Clean up first if similar features are coming. If more features like it are on the way, removing the mess first can end up faster overall.

So rather than saving it all for a big clean-up project later, you can build tidy-up time into the schedule for each feature. Fowler sees refactoring as part of everyday programming, not a special task in the project plan (Refactoring.com).

Questions to ask your developer

  1. "Is there any clean-up we've put off? Where is it?" Deliberate debt can be written down as a list. Ask for it in writing.
  2. "Is there time for clean-up in the schedule?" If new features keep piling on, each one can take longer than the last.
  3. "Would cleaning this up now make the next job faster?" If it's an area you'll change often, it may be worth doing first.

Our honest take

Technical debt doesn't mean your developer did a bad job. Some is taken on deliberately to launch sooner, and some only shows up once the team learns a better way. What matters is knowing where it is and leaving time to clean it up. For getting a first version out quickly, see what an MVP is. For looking after a site or app after launch, see website maintenance.

Sources

Have an idea, or a problem to solve? Let's talk.

We'll listen first, then give you honest advice on the best way forward.

Book a free consultation

We reply within one business day.

Prefer to email first? admin@jsoftware.solutions