AI Code Makes Dumb Mistakes. Your Old Code Made Expensive Ones.
Critics screenshot AI making dumb coding mistakes and call it proof. But the hand-crafted legacy code they're comparing it to was a Jenga tower of technical debt where changing one thing broke three others. Debt was always the real enemy, and AI is the first tool that makes paying it down cheaper than carrying it.
Every week somebody posts a screenshot of AI writing something stupid. An off-by-one error, a hallucinated library, a function that returns the wrong type. And the caption is always the same: see, this is why you can't trust AI code.
And right next to it on my feed, every other day, is this picture.

I've been writing code by hand for a long time, and I'd like to introduce whoever keeps posting that to the codebases I've actually inherited. Because the thing on the right, the clean, careful, hand-crafted legacy system, mostly never existed. What existed was a Jenga tower held together with comments that said "don't touch this."
The old code was never good
Here's what a real legacy codebase looks like. Three different ways of talking to the database, because three different people wrote it over six years. A utility file that's four thousand lines long and named helpers.js. Business logic in the view layer, view logic in the database triggers, and a cron job nobody can explain that everything breaks without. Change one thing and something unrelated breaks, not because the code is complex, but because nothing is isolated and everything is secretly holding hands.

I've written code like that. Everybody who's shipped under pressure has. You don't do it because you're bad. You do it because it's Thursday and the demo is Friday and the clean version would take until Tuesday. Then Friday passes, and the hack becomes load-bearing, and two years later a new hire is reading it at midnight wondering what kind of person would do this.
So when someone says AI code is sloppy, my honest reaction is: compared to what? Compared to the textbook? Sure. Compared to the actual average codebase running the actual average company? It's not even close. The average codebase is worse.
And to be fair to the meme, the left panel is real too. There are plenty of people shipping apps on vibes with an Airtable backend who are going to find out what happens at user number four. I wrote the long version of that in The Vibe Coder to Software Engineer Pipeline: vibe coding isn't the end of engineering, it's the on-ramp to it, and the ditch on either side is real. But the honest picture isn't a junk pile next to a cathedral. It's a junk pile next to an older junk pile that somebody put a nicer door on.
The real enemy was always technical debt
The thing that kills software isn't a dumb mistake. Dumb mistakes get caught. A test fails, a user reports it, you fix it in an hour. What kills software is debt: the accumulated weight of every shortcut, every "we'll fix it later," every pattern that was fine at a thousand users and is now a wall at a hundred thousand. Debt compounds. Every new feature costs more than the last one because you're building on top of the pile, and eventually the pile costs more to maintain than it would to replace, and nobody's brave enough to replace it.

That's the actual scoreboard. Not "did the code have a bug today." It's "how much does it cost to change this thing next year." And on that scoreboard, hand-written legacy code has been losing for decades, long before anyone had an AI to blame.
What AI is actually good at, and it's this
Here's the part the critics miss entirely. AI isn't just a thing that writes new code with occasional dumb errors. It's the best debt-reduction tool I've ever used, and I've used all of them.
Point it at the four thousand line helpers file and say "split this into modules by responsibility and write tests for each." It does it in an afternoon. A human would need a week and would quit halfway through out of despair. Ask it to find every place the codebase talks to the database three different ways and unify them. It finds them. Ask it why the cron job matters. It reads the whole thing and tells you, which no human on the team could do because the person who knew left in 2021.
Refactoring used to be the thing nobody did, because it's tedious, it's risky, and it doesn't ship a feature. AI made the tedious part free and the risky part safer, because it'll write the tests before it touches anything if you ask it to. For the first time in my career, paying down debt is cheaper than carrying it. That changes the whole economics of software.
And debugging. It's genuinely excellent at the low-level stuff. The null check you missed, the race condition in the async handler, the edge case where the string is empty. It reads a stack trace faster than I do and it doesn't get tired at line four hundred. The dumb mistakes people screenshot are real, but it's also the thing that catches ten dumb mistakes for every one it makes.
What it's still bad at, and why you still have a job
None of that means you hand it the keys. AI is a brilliant junior engineer with no memory of last Tuesday and no opinion about where the company is going. It can fix a function. It cannot decide whether that function should exist.

Architecture is still yours. Which service owns which data. Where the boundaries go. What's going to hurt at ten times the scale. Whether to build the thing at all. Those are judgment calls that need to know what the business is for, and the model doesn't, and won't, because you haven't told it and most of it isn't written down anywhere. Hand it a bad architecture and it'll implement the bad architecture beautifully, fast, with tests. That's worse, not better.
So the job changes. You stop being the person who types every line and start being the person who holds the design in your head, breaks it into pieces the machine can execute, and checks the pieces against the whole. I wrote about this when I gave Claude an org chart. The model is the team. You're the one who still has to know what you're building.

The honest comparison
Stop comparing AI code to perfect code. Nobody has perfect code. Compare it to the thing it's replacing, which is tired humans writing under deadline pressure and never going back to clean up. On that comparison:
- AI makes more small mistakes per line. True. It also catches more of them, and the ones it makes are cheap.
- Legacy code makes fewer visible mistakes and carries far more invisible debt. The debt is the expensive part.
- AI makes refactoring cheap for the first time ever. That alone pays for every dumb error it'll ever make.
- AI has no architectural judgment. That's your job now, and it's the whole job.
- A human orchestrator plus an AI team beats a human team alone on both speed and debt. I've run both. It's not a debate anymore.
The golden age of hand-written code is a story we tell ourselves because the alternative is admitting the mess was always ours. It was. The good news is we finally have something that'll help clean it up, as long as somebody's still standing at the drafting table deciding what the building is for.
Want to talk about what you're building?
Get in touch


