Legacy Code Isn’t Technical Debt. It’s Your Company’s Memory.

You’ve been there. You’re trying to buy movie tickets on Fandango—or fill out a form on an insurance site, or check your bank balance—and the whole thing feels like it was designed in 2008. Buttons lag. The checkout crashes. You scream at your screen. And then you think: Why don’t they just rebuild this thing? AI can write code now. It would take a weekend.

I used to think that too. Until I spent time with the people who actually run these systems.

Here’s the truth nobody in Silicon Valley wants to admit: The most valuable code in your company is the stuff you’re embarrassed to show anyone.

That old, ugly, spaghetti-like codebase isn’t a pile of technical debt waiting to be erased. It’s a living, breathing archive of every business decision, every edge case, every workaround, and every unspoken rule that your company has accumulated over a decade or more. It’s your company’s institutional memory, written in a language that no one fully understands anymore.

When I was working at arXiv, a math professor on our advisory board couldn’t believe it took months to roll out upgrades. He said he could code up a site like arXiv in a weekend. And he could—except it wouldn’t do all the invisible things that the legacy system does. It wouldn’t handle the weird edge case where a submission from a certain institution needs a different review workflow. It wouldn’t remember the API integration that a partner has depended on for years. It wouldn’t capture the reason why that particular field is required.

That’s the real cost of rebuilding. Not the code. The knowledge.

Rebuilding isn’t rewriting code; it’s the expensive process of rediscovering and re-verifying years of unstated business rules.

Now enter the AI hype. Everyone thinks, “We’ll just feed the old code into an LLM and get a shiny new version.” But AI doesn’t know why the code does what it does. It doesn’t know that the discount logic is tied to a forgotten contract with a vendor from 2014. It doesn’t know that the weird sorting order exists because a customer complained once. It doesn’t know the human history embedded in every line.

So when you rebuild with AI, you don’t just rewrite code—you rewrite history. And you risk losing the very thing that makes your business work: the accumulated, battle-tested logic that survived a thousand production incidents.

This is why the “rebuild cost recoups in months” argument is a fantasy. It’s not just about engineering hours. It’s about the months of digging through emails, interviewing old employees, and reverse-engineering production logs to figure out what the hell that one function actually does. And even then, you’ll get it wrong. Something will break. A partner will lose data. A customer will get double-charged.

I’m not saying you should never rewrite. Some systems become so brittle that they pose a real risk. But the arrogance of the “just use AI” crowd is dangerous. It treats legacy code as garbage instead of the gold mine of business knowledge it actually is.

The next time you curse an old app, remember: the code you hate is the reason your bank still works, your insurance still pays out, and your tickets still print.

Maybe the real problem isn’t the code. Maybe it’s our collective failure to respect the invisible, fragile, and utterly human process of building software that actually lasts.

FAQ

Q: Why can't we just use AI to extract the logic from legacy code?

A: AI can parse syntax, but it cannot recover the historical context, business rationale, or unspoken assumptions behind each line. The logic is embedded in human decisions, not just code structure.

Q: What should companies do instead of a full rebuild?

A: Gradually extract and document critical business rules, then refactor isolated modules. Focus on creating a clear separation between stable business logic and volatile UI or infrastructure. Use AI for small, targeted rewrites, not wholesale replacement.

Q: Isn't all legacy code just bad code that should be thrown away?

A: Some legacy code is genuinely bad, but the majority works because it embodies decades of real-world testing. Throwing it away means losing that validation. The real question is whether the business value of the accumulated knowledge outweighs the maintenance cost.

📎 Source: View Source