AR7: Choosing technology and managing technical debt
Technical debt
🎯You'll be able to
Explain technical debt and its "interest", and tell deliberate, sensible debt from careless debt.
🏠The everyday picture
A shopkeeper who borrows to stock up before Diwali is using debt wisely, if they pay it back. One who borrows without noticing, and pays interest every month on old loans, slowly has less to spend on the shop.
📘What it really is
-
Technical debt (a metaphor from Ward Cunningham) is the future cost of a shortcut in code or design. It's paid back by fixing it; until then you pay interest: extra time on every change, more incidents, slower onboarding.
-
Martin Fowler's quadrant: debt can be deliberate or inadvertent, and prudent or reckless. "We'll ship now and fix it next sprint" can be prudent and deliberate; "what's a module?" is reckless and inadvertent.
-
Not all old code is debt. Code that works and rarely changes costs little interest.
- Debt is highest where code changes often (AR4's hotspots).
- Make it visible, with figures, or it can't compete with features for time.
📝A worked example
Input: debt items in the RasoiRoute starter.
Steps:
- Five internal reaches and a cycle: every change to orders risks reports, invoices and notifications. Interest: slower changes, rollbacks (22.2% of deploys).
- Orders waiting for SMS: interest paid in incidents (42.3% start in notifications).
- A key written in the code: low interest until it leaks, then very high.
- A 44-line
placeOrder: some interest each time it's changed.
Expected output: four debt items, each with its interest described in time, incidents or risk.
🌍Where it's used
- Engineering managers report debt alongside features in planning.
- Incident reviews often find a debt item as the underlying cause.
- Due diligence for investments and acquisitions looks for unmanaged debt.
📝Case scenario
A fintech team took a deliberate shortcut, hard-coding one bank's rules to launch quickly, and wrote it down. Six months later, adding a second bank took three weeks instead of one, and they paid the debt back as part of that work. The debt was useful because it was chosen and recorded.
🖱️Try it
List three shortcuts in a project of yours, and place each in Fowler's quadrant. Success: each has the interest it costs.
⚠️Common mistakes
- Calling everything debt. Sign: "all old code is debt". Fix: look for the interest it charges.
- Debt nobody records. Sign: shortcuts remembered by one person. Fix: a debt register (Lesson 4).
- Treating all debt as bad. Sign: refusing any shortcut. Fix: take prudent debt deliberately and pay it back.
🛠️For your project
The capstone's design notes begin with a technical debt register of at least five items, with their interest and cost to fix.
✅Quick check
What is the "interest" on technical debt?
Show the answer
The extra cost the shortcut causes until it is fixed: slower changes, incidents, risk.
Which debt usually costs most interest?
Show the answer
Debt in code that changes often.
