Playbook · Technical debt and legacy code

Updated

What does technical debt look like in a real codebase?

Technical debt examples are rarely dramatic. In the codebases I have worked on, it was a large app in plain JavaScript, an Angular 10 app full of dead code, keys written into the source, and an old logs table that had grown past 24 GB.

In a longitudinal study of 43 developers, plus 16 interviews, developers lost on average 23% of their working time to technical debt.
Source: Besker, Martini and Bosch, Journal of Systems and Software, 2019

From my work

Every example on this page comes from code I reviewed or maintained. Where the client is named, the name is already on this site. The file upload stays anonymous.

Code debt: a big app with no types

When I reviewed one client’s app, the code was well written, with a clean separation of concerns. I gave it 8 out of 10. The missing points were types. It was plain JavaScript, and on a project that size code like that gets messy fast unless every developer is careful. TypeScript, or even JSDoc comments, would have made it a 10.

This is debt in good code. Nothing is broken today, but every change costs a bit more care than it should, and care is the first thing to go when a deadline gets close.

Dead code and unused libraries

At Mom Software the legacy app ran on Angular 10, followed no pattern, and carried a lot of dead code and unused libraries. Each unused library is still something to update, audit and ship to users, and it does nothing in return. We stopped patching it, started again on a Fuse template, and moved the old code over module by module.

Security debt: hard-coded keys and old versions

The same Mom Software app had hard-coded keys and insecure third-party libraries, and its Angular version no longer got security updates. The architecture work removed the first two and moved the app to a supported version. This kind of debt does not slow the team. It waits until someone finds it.

An upload nobody checked

The worst issue I have found in someone else’s code was a file upload with no check on file type or size, on the front end or the back end. Anyone could upload anything, of any size.

Data debt: a 24 GB logs table

On one project the client noticed a spike in the AWS bill. CloudWatch showed PostgreSQL queries hitting an old logs table of more than 24 GB. Most queries asked for a time range, so I partitioned the table by quarter. The same look found EC2 instances nobody used anymore, still running. I deleted them.

Infrastructure debt: servers too small for the users

The same app had server timeouts. My first view was that the Heroku dynos were too small for the user base. The client wanted a fix in the code first, so we added caching and tuned the PostgreSQL and Neo4j queries. That was worth doing, but in the end we still upgraded the dynos. Code work cannot pay off debt that lives in the hosting.

Product debt: staying on no-code too long

The most expensive pattern I see is a startup that relies on no-code and third-party tools for almost everything, long after the MVP proved the idea. Each tool was a fair shortcut on the day it was picked. Nobody plans to stay on them. The decision to leave just never gets made. Together they become a product nobody can change without a migration.

Read next

Sources

Start

Tell me where the product is stuck.

In 30 minutes we look at where things stand, what you need from a CTO right now, and which option fits. Either way, you leave with a clear next step.

How the call goes

  1. 01You tell me about the product, the team and the next 6 months.
  2. 02I ask about the code, the stack and what keeps breaking.
  3. 03We pick the option that fits, or agree that none does.

09:00 to 20:00 CET

Founding rate: the first 3 clients get 20% off, in return for a named testimonial and a case study. On a monthly plan, the 20% applies to the first month.