Accent colour
 
Shortcuts: press ?
 

Technical Debt Explained — Why Quick Fixes Cost You Later

Muhammad Tahir November 23, 2026

Introduction

In 2011, a small team I knew shipped a food-delivery app in nine weeks. It was a rush job from start to finish. The launch date had been set by a marketing campaign, the campaign could not move, and so the code could not wait. They skipped the tests. They copied the same pricing logic into three different places because it was faster than building it once properly. They left a note in the code that said, in plain English, "fix this later." The app launched, people ordered lunch, and everyone celebrated. Two years later, that same team needed six weeks to change the delivery fee from $2.99 to $3.49, because the price lived in those three places, plus a spreadsheet, plus a hard-coded value in the mobile app that nobody remembered. The six-week job should have taken an afternoon. That is technical debt, and if you have ever worked on software for more than a year, you have met it.

The phrase was coined by Ward Cunningham, one of the people behind the Agile Manifesto, back in 1992. He was trying to explain to business people why a shortcut in code was not free. Borrowing money lets you buy something now and pay later, with interest. Shipping code with a shortcut is the same deal: you get the feature now, and you pay interest every time you touch that part of the system, until you pay the principal back by fixing it properly. Cunningham's point was not that debt is always bad. Sometimes borrowing is the right call. His point was that you should know you are borrowing, and know what it will cost.

What Technical Debt Actually Is

At its simplest, technical debt is the gap between the code you have and the code you would write if you had the time, the knowledge, and the calm to do it well. Every codebase has some. A new developer joins, reads a function, and finds it does three things at once. A library was the best choice in 2019 and is now barely maintained. A database table has a column called `temp_flag_2` and nobody alive knows what it was for. None of that means the team was lazy. It means software lives in the real world, where deadlines exist and knowledge grows over time.

Debt comes in two broad flavours, and the difference matters. Deliberate debt is a choice: we know this is a shortcut, we are taking it on purpose to hit a date, and we have written down that we will come back to it. Accidental debt is the kind you do not notice until later: you did not know the library would be abandoned, you did not realise two systems would need to talk to each other, you wrote code that made sense for ten users and fell apart at ten thousand. Deliberate debt can be managed, because someone is watching it. Accidental debt is the dangerous kind, because nobody is watching it at all.

There is also a third kind that people forget about: debt that arrives without anyone writing a bad line of code. The world moves, and your code stays still. A security flaw is found in a library you depend on. A browser changes how it handles something. A payment provider changes its API. Your code was fine when you wrote it, and now it is out of date. Engineers sometimes call this bit rot, and it is why a system that nobody touches still needs care. Leave a house empty for five years and the roof leaks. Leave a codebase untouched for five years and the same thing happens, just more quietly.

How Debt Builds Up in Real Codebases

Debt rarely arrives in one dramatic moment. It arrives in small, sensible decisions that add up.

The first is the deadline shortcut. A feature is due Friday, the clean way takes a week, the quick way takes a day. The team takes the quick way and means to come back. Then Friday becomes next month's release, next month's release becomes a new project, and the shortcut becomes load-bearing. This is the most common way debt is born, and the most forgivable. Deadlines are real. The mistake is not taking the shortcut; it is never scheduling the return visit.

The second is copy and paste. A developer needs the same logic in a new place, and copying it is faster than pulling it out into a shared piece of code. Now there are two copies. A bug is fixed in one and not the other. A price changes in one and not the other. The food-delivery team from the introduction had three copies of their pricing logic, and that is exactly how a one-afternoon change became a six-week project. Every copy is a promise that someone will remember to update all of them, and people are bad at keeping that kind of promise.

The third is the missing test. Tests are the safety net that lets you change code without fear. When a team skips tests to go faster, they do go faster — for a while. Then the fear arrives. A developer wants to change a function but has no way of knowing what will break, so they add a new function beside the old one instead of changing it. Then another. Soon there are four ways to do the same thing, and nobody dares remove any of them. Our guide to unit testing covers why that safety net matters, and how teams build it without slowing to a crawl.

None of these are dramatic. That is the point. Debt is not usually one bad decision. It is a hundred small ones, each reasonable on its own, that nobody added up until the bill arrived.

What It Actually Costs

Talking about debt in the abstract does not convince anyone. The costs are concrete, and they show up in four places: speed, quality, morale, and risk.

Speed goes first, and it goes gradually. A new feature that took two days in the first year takes a week in the third year, and nobody can say exactly why. The answer is usually that every change now touches five places instead of one, needs testing in three systems instead of one, and requires asking two people who are busy with something else. The team is not slower because they are worse. They are slower because the ground they are walking on has got harder.

Quality goes next. When code is hard to change safely, developers change it carefully, which sounds good until you see what "carefully" means in practice: they add code beside the old code instead of fixing it, they avoid touching the scary parts, and the scary parts get scarier. Bugs become harder to find because the logic is spread across places that were never meant to work together. A fix in one place breaks something in another, and the team starts to expect that, which is a bad sign. A team that expects its fixes to break things has stopped trusting its own system.

Morale is the cost nobody puts in a spreadsheet, and it is often the biggest. Good developers do not leave a job because the work is hard. They leave because the work is frustrating: because every simple task turns into an archaeology dig, because they spend their days fighting the codebase instead of building things, because they proposed fixing a problem six months ago and nothing happened. The best people leave first, because they have the most options, and their leaving makes the debt worse, because the knowledge leaves with them.

Risk is the cost that makes the news. The most famous example is Knight Capital, a trading firm that lost $440 million in 45 minutes in August 2012. The cause, as widely reported afterwards, was old, unused code that had been left in the system — dead code that was accidentally switched back on during a software update, and then bought and sold shares at a furious pace before anyone could stop it. One firm, one morning, nearly half a billion dollars, because code that should have been removed years earlier was still sitting there. It is an extreme case, but it is not a freak accident. It is what happens when a system carries code nobody understands and nobody has cleaned up.

How to Tell You Have a Problem

Most teams know they have a debt problem long before they admit it. The signs are easy to recognise once you name them.

  • Simple changes take a surprisingly long time, and estimates keep being wrong in the same direction — always longer than expected, never shorter.
  • Developers avoid certain files or parts of the system, and everyone knows which parts those are without being told.
  • The same bug keeps coming back, fixed in one place and reappearing in another, because the logic lives in several places at once.
  • Onboarding a new developer takes months instead of weeks, because the system can only be understood by asking the two people who built it.
  • The team talks about a rewrite. Not a specific fix, but a full rewrite, from scratch, as if the only way out is to burn it down and start again. That is usually a sign the debt has become hard to face, not that a rewrite is the right answer — rewrites have their own famous failures, and they are rarely the cheap escape they look like.

If three or more of those sound familiar, the debt is not a background issue any more. It is the main thing slowing the team down, and it is worth treating as a project in its own right, not as something to fix "when we have time," because that time never arrives on its own.

Paying It Down Without Stopping New Work

The most common objection to fixing technical debt is that it means stopping everything else. Nobody wants to tell customers, or a boss, that no new features will ship for six months while the team cleans up. The good news is that the teams who succeed at this almost never stop everything. They pay the debt down in small, steady amounts, the way you would pay off a loan.

The simplest method has a homely name: the boy scout rule. Leave the code a little better than you found it. Every time you touch a file to build a feature, spend a little extra time tidying what you touched — rename a confusing variable, delete a dead function, add a test for the part you changed. It does not sound like much, and it is not, on any single day. Over a year, across a whole team, it adds up to a real change, and it costs almost nothing, because the developer is already in that part of the code, already thinking about it.

A second method is to set aside a fixed share of time. Many teams use 20 percent: one day a week, or one sprint in five, spent on debt and maintenance instead of new features. The number matters less than the fact that it is fixed and protected. If the time is "whenever we have a spare moment," it will never happen, because there is never a spare moment. If it is every Friday, or the first week of every month, it happens, and the team can plan around it. The trick is to protect it when a deadline looms, because a deadline is exactly when the temptation to spend it on features is strongest — and exactly when the debt is doing the most damage.

A third method is to attach the fix to the feature. If a new feature needs to touch a messy part of the system, fix that part first, as part of the same job. The feature pays for its own cleanup, and the cleanup is never a separate project that needs separate approval. This works well because it is easy to explain to a non-technical manager: "To build this properly, we need to sort out the pricing code first, and that will make the next three features faster too." That is a business case, not a technical complaint, and business cases get approved.

When Debt Is the Right Choice

It is worth saying clearly, because articles about technical debt sometimes sound like a scolding: taking on debt is not always wrong. Sometimes it is the smartest thing a team can do.

A startup testing whether anyone wants its product should not spend six months building a perfect system for a product nobody has tried yet. It should build the rough version, find out if people want it, and then, if they do, rebuild the parts that matter. A company racing to fix a security flaw should patch it quickly and cleanly later, not spend a week on the elegant solution while attackers walk in. A team with a hard launch date, a real one, not an invented one, may be right to cut a corner and pay it back the following month.

The difference between good debt and bad debt is not the shortcut itself. It is whether the decision was made on purpose, written down, and given a date for repayment. Good debt has an owner, a reason, and a plan. Bad debt has none of those, and it is usually discovered years later by someone who was not in the room when the decision was made. If you take on debt, do it the way you would take on a loan: know how much you borrowed, know what it will cost, and know when you will pay it back.

Tools and Habits That Keep Debt Low

No tool fixes technical debt on its own, but the right habits make it much harder for debt to build up unnoticed. Automated tests are the first of these, because they are what make change safe. A team with good tests can refactor — restructure code without changing what it does — with confidence, because the tests will catch a mistake within minutes. A team without tests cannot refactor safely, so it does not refactor at all, and the debt grows. If your team does one thing after reading this article, make it this: add a test for the next thing you change, and then the next.

Code review is the second habit, and it works best when it is about learning rather than policing. A second pair of eyes catches the copy-and-paste, the confusing name, the shortcut that should have been written down. It also spreads knowledge around the team, so the system does not live in one person's head. The review does not need to be long or formal. Fifteen minutes, a few honest questions — "Why is this copied here?" "What happens if this changes?" — will catch most of the debt before it is merged.

Automation helps too. A pipeline that runs the tests on every change, and refuses to merge code that fails them, takes the argument out of it. Nobody has to be the person who says no; the pipeline says it, politely and consistently. Our guide to CI/CD pipelines explains how that pipeline works, and why teams that build it wonder how they ever worked without it. Version control, covered in our guide to Git and GitHub, is the other half of the same habit: it keeps a record of what changed, when, and why, so a future developer is not guessing.

Frequently Asked Questions

Is all technical debt bad?

No. Some debt is a deliberate, sensible choice — borrowing time to hit a real deadline, or to test an idea before investing in it properly. The debt becomes a problem when it is taken on without anyone noticing, when it is never written down, and when it is never repaid. The test is simple: can someone explain why it is like that, and when it will be fixed? If the answer is yes, it is being managed. If the answer is a shrug, it is not.

How do I convince my manager to let us fix technical debt?

Talk about it in their language, not yours. Managers do not care about clean code for its own sake, and they should not have to. They care about speed, cost, and risk. So say: "Changing the delivery fee takes six weeks because the price is in three places. If we spend two weeks fixing that, the next change will take an afternoon." That is a business case with numbers in it. Bring one example, with a real time attached to it, and most managers will listen. Bring a vague complaint about the codebase being a mess, and most will not.

How much time should a team spend on technical debt?

There is no single right number, but a common starting point is about 20 percent — one day a week, or one sprint in five. The exact share matters less than the fact that it is regular and protected. A team that spends a little time every week will make steady progress. A team that waits for a quiet month will wait forever, because software teams do not have quiet months. Start with a share you can defend, keep it for three months, and look at whether changes are getting faster. Adjust from there.

Can technical debt cause a security breach?

Yes, and Equifax is the clearest example. The breach came through a known flaw in a piece of software, for which a patch had been available for months, and the patch had not been applied. Out-of-date libraries, unpatched systems, and code nobody understands are all forms of debt, and they are exactly the places attackers look. Keeping software up to date is not glamorous work, but it is some of the most valuable security work a team can do — and our guide to zero-day vulnerabilities explains what happens when a flaw is found before a fix exists at all.

The Bottom Line

Technical debt is not a sign that a team is bad at its job. It is a sign that a team has been doing its job in the real world, where deadlines exist, knowledge grows, and the world moves on while the code stays still. Every codebase has some, and the teams that handle it well are not the ones with no debt. They are the ones who know where their debt is, what it costs, and when they will pay it back.

The food-delivery team from the start of this article did eventually fix their pricing code. It took three weeks, not six, because by then they had tests in place and two developers who understood the system. The next time the delivery fee changed, it took an afternoon, just as it should have. Nobody celebrated that change. Nobody should have to. It was ordinary work, done properly, and that is the whole point. Debt is not paid off in a grand gesture. It is paid off in small, steady amounts, by a team that has decided to stop borrowing without a plan — and to keep the code a little better than they found it, every time they touch it.

Was this article helpful?

Muhammad Tahir

Author

 

Get new articles by email

 

Comments