For a long time, I believed technical debt was about poorly written code, and that "coding better" would be enough to avoid it. Seventeen years spent evolving the same SaaS product taught me the opposite: debt builds up mostly through decisions that, taken one by one, made sense.
In the beginning, sensible choices
In 2009, I wrote the first lines of an HR platform for time management. I was alone, with no specifications, working from needs explained verbally and adjusted along the way. I chose PHP, the language I knew best, and started without a framework, writing procedural code.
Looking back, that choice wasn't a mistake. It fit my knowledge and the constraints of the time: we had to ship a working product, fast. But it taught me something essential:
An architecture decision made when a product launches can shape its evolution for decades.
The real sources of debt
When I look back, I rarely see "bad code". I see a context that produced debt day after day:
- No specifications. Without written use cases, every developer interprets the need, and the code becomes the only documentation.
- Constant urgency. When bugs and customer requests keep coming, you ship the fix, never the refactoring that would have prevented it.
- No automated tests. Without a safety net, nobody dares touch the stable parts… until the day you have to.
- Saying yes by default. Accepting every request without measuring its architectural cost is borrowing without ever checking the interest rate.
- Concentrated knowledge. When only one person knows the whole product, debt becomes invisible to everyone else.
The day the product changes scale
Debt stays manageable as long as the product evolves in the direction it was designed for. It becomes a wall the day large customers ask for structural changes: topics nobody thought of at the start, which require rewriting pillars of the code that had been stable for years.
Without tests, every change to a pillar weakens dozens of features that depend on it. Regressions multiply, user trust erodes, and the team spends more time fixing than building.
The temptation to rewrite everything
In 2020, we did what many teams consider one day: start over from a blank page to wipe out the debt. Three developers from my team worked on it for almost three years. The project was eventually stopped.
That failure taught me more than many successes:
- The target kept moving. During the rebuild, the production version kept evolving. The new version was chasing a product that never stood still.
- A rewrite is a company project, not a technical one. Without strong backing from leadership and a clear place in the strategy, it remains a side project.
- Visibility matters as much as progress. Without demonstrable milestones, a three-year rebuild looks, from the outside, like three years without results.
What worked: modernizing step by step
After that attempt, we changed approach. Rather than rewriting everything, we gradually introduced modern building blocks inside the legacy code. Adding Slim, a lightweight framework, to structure routing and expose REST APIs was the most significant improvement of recent years: it fits perfectly into the existing code without calling everything into question.
We complemented this with tools that make debt visible: Sentry for error monitoring, SonarQube for code quality analysis, and stricter code reviews before each release.
How I manage debt today
My conviction is simple: technical debt isn't eliminated, it's managed. In practice:
- Make it visible, with metrics and a shared inventory, not just in developers' heads.
- Translate it into business risk: "this module slows down every payroll change", rather than "this code is messy".
- Pay it down continuously, improving what you touch and reserving a regular share of the team's time.
- Test what you change, so every change leaves the code safer than before.
- Know how to say no, or rather "yes, but here is what it will cost", and let the business decide with full knowledge.
Key takeaways
- Debt comes from reasonable decisions, rarely from negligence.
- Day-one choices weigh for years, so make them consciously.
- A full rewrite often fails for lack of backing, not lack of skills.
- Modernizing progressively, at the heart of the existing code, is often safer than starting over.
I don't regret the choices of 2009. I only regret not questioning them sooner, and too often saying yes without explaining what each "yes" cost the product. It is probably the most useful lesson I can pass on to a team.