Technical Debt
- Node.js
The accumulated cost of shortcuts and quick fixes that make future changes harder — a debt that charges interest and must be managed deliberately, not ignored.
What you'll understand
- What technical debt is and where it comes from
- Why it is described as charging interest
- How to manage debt deliberately rather than let it accumulate
Explanation
Technical debt is the accumulated cost of choices that made the short term easier at the expense of the long term: a shortcut taken to hit a deadline, a quick fix that was never cleaned up, a design that no longer fits what the software does. Like financial debt, it is not inherently bad, sometimes borrowing time is the right call, but it must be tracked and repaid, because ignored debt compounds.
The metaphor’s power is the idea of interest. Debt-laden code charges interest in the form of extra effort on every future change: things take longer, bugs are more likely, and developers grow afraid to touch fragile areas. It also comes in different kinds, deliberate and sensible ("ship now, refactor next sprint"), or reckless and inadvertent (a mess made without realising). Naming which kind you have helps you decide how urgently to address it.
The goal is not zero debt, which is impossible, but deliberate management. Make debt visible by tracking it rather than pretending it does not exist, repay high-interest debt through refactoring, improving code structure without changing behaviour, and prevent needless debt through the practices in this curriculum: sound design (see Related Topics on SOLID and clean architecture), tests that make change safe, and code review that catches problems early (see Related Topics). Debt you choose and manage is healthy; debt you ignore eventually grinds progress to a halt.
Examples
A comment that flags known debt makes it visible so it can be tracked and repaid deliberately:
// TODO(tech-debt): temporary in-memory cache; replace with shared cache
// before we scale to multiple instances. Tracked in issue #482.
const cache = new Map<string, User>();Common mistakes
- Pretending debt does not exist instead of tracking it.
- Taking reckless shortcuts without realising the future cost.
- Chasing zero debt and rewriting things that work fine.
- Never allocating time to repay high-interest debt, so it compounds.
Best practices
- Make technical debt visible by tracking it explicitly.
- Take on debt deliberately, and know why, rather than by accident.
- Repay high-interest debt through incremental refactoring.
- Prevent needless debt with good design, tests, and reviews (see Related Topics).
Further reading
- Martin Fowler, TechnicalDebt — https://martinfowler.com/bliki/TechnicalDebt.html
- Martin Fowler, TechnicalDebtQuadrant — https://martinfowler.com/bliki/TechnicalDebtQuadrant.html