There's No Limit to How Bad Code Can Get

Simon Willison's Blog News

Summary

Simon Willison argues that completely rewriting legacy systems from scratch rarely succeeds and typically results in two parallel systems in production. He recommends shoring up the old system with automated testing and targeted refactors instead, citing Will Larson's writing on migrations as the best responsible approach.

No content available
Original Article
View Cached Full Text

Cached at: 09/06/26, 08:14 PM

# Comment: There's No Limit to How Bad Code Can Get Source: [https://simonwillison.net/2026/Sep/6/theres-no-limit-to-how-bad-code-can-get/](https://simonwillison.net/2026/Sep/6/theres-no-limit-to-how-bad-code-can-get/) 6th September 2026 *\[In reply to a comment about burning it down to start from scratch when technical debt becomes overwhelming\]* In my experience it's*so rare*for that to work\. You announce the old thing is irrecoverably drowning in tech debt\. You spin up a team to rewrite it from scratch\. Work begins\. Meanwhile the old thing remains a moving target: it's running the core business, so changes are still necessary\. The developers working on it know that it's going to be made obsolete by the new thing soon, so they don't have any incentive to go beyond the smallest effort possible to add the new features\. Technical debt continues to mount\. Meanwhile, the team working on the new thing are ambitious and probably a little naive\. They start out at a great pace \- it's greenfield after all \- but as time progresses it becomes apparent that nobody fully understands the behavior and scope of the thing they are replacing\. If it was well documented and tested it wouldn't*need*to be replaced, after all\.\.\. After months \(or even years\) without delivering value, the pressure is on to "ship it", so the new system is launched to handle a subset of what the old system handled \- or often for some new feature that was too hard to build with the now mostly unmaintained old system\. \.\.\. so now you have TWO systems in production \- the janky old system that nobody wants to touch, and a new system which handles just a few production features and is 80% inactive code that is meant to replace the old system, eventually\. If you're*really lucky*the company won't have lost patience with the new system and will allow that work to continue\. The longer this all takes, and the longer the old system stays in production and stubbornly continues to work, the higher the risk that "priorities have changed" and the new system total replacement work is abandoned, leaving you with two systems where you used to have one\. The best article I've read about completing this process responsibly is[Migrations: the sole scalable fix to tech debt](https://lethain.com/migrations/)by Will Larson\. If I run into a situation like this in the future, my strong recommendation will be to shore up the old system with as much automated testing as possible and then seeing if targeted refactors can get it to the desired shape\. My hunch is that in many cases that will have a much higher chance of success than the siren call of a greenfield replacement\.

Similar Articles

The Wheels We Keep Reinventing

Lobsters Hottest

An essay arguing that software engineers repeatedly reinvent well-solved infrastructure like auth, background jobs, rate limiting, and feature flags, trading proven solutions for custom code that they must maintain and debug.

When Modernization Breaks Working Code: A Study of LLMs on Legacy PHP

Hacker News Top

An arXiv study evaluates five LLMs asked to modernize 100 legacy WordPress 4.0 PHP files to PHP 8.3, finding that the best model breaks 59 previously working files versus the 83 that pass unchanged, while the rule-based Rector tool breaks only 7 — concluding that LLM modernization evaluations must include a no-change baseline and report behavioral preservation separately.

Coding Models Are Doing Too Much

Hacker News Top

A blog post investigating the "Over-Editing" problem where coding LLMs rewrite more code than necessary when fixing simple bugs, proposing metrics and training approaches to encourage minimal, faithful edits.