DEV Community

Cover image for AI Writes the Code Now — Which Is Exactly Why Architecture Matters More
Anna Hartung
Anna Hartung

Posted on

AI Writes the Code Now — Which Is Exactly Why Architecture Matters More

By Anna Hartung — H-Studio Berlin

There's a comfortable story going around: AI coding tools made architecture less important. If you can generate a feature in thirty seconds and regenerate it when it breaks, who cares about clean boundaries? Just vibe it.

The data from 2024–2025 tells a less comfortable story. We're producing code faster than ever — and a measurable amount of it is the kind you pay for later. AI didn't make architecture optional. It made the lack of it cheaper to create and more expensive to live with.

What the data actually shows

GitClear's 2025 report, analyzing over 200 million changed lines of code, found a few things worth sitting with:

  • Copy-pasted code overtook refactored ("moved") code for the first time in 2024. Cloning rose while restructuring fell.
  • Refactoring collapsed — lines associated with refactoring dropped from about 25% of changes in 2021 to under 10% in 2024.
  • Duplicate code blocks spiked — the frequency of copy-pasted blocks rose sharply as AI assistants went mainstream (devclass summary here).
  • Churn went up — the share of new code revised or reverted within two weeks of being committed climbed year over year, a proxy for "shipped before it was understood."

Academic work is pointing the same direction: a 2025 study on vibe coding in practice documents the flow benefits and the technical-debt cost, and argues for guidelines to keep it sustainable.

None of this says AI coding is bad. It says AI optimizes for producing code, and producing is not the same as structuring.

Why AI pushes you toward duplication, not design

It's not mysterious once you look at the mechanics.

AI generates; it rarely refactors. Asked for a feature, a model gives you a working block. Asked for a similar feature, it gives you another working block — not "extract the shared logic from the first one." Left unchecked, that's literally how you get a 4x rise in duplication.

It optimizes locally. A model is brilliant at the next function and blind to your system. It doesn't know that the thing it just wrote belongs behind an existing interface, or that you already have a service for this.

It removes the friction that used to force structure. Writing the third near-identical handler by hand used to hurt enough that you'd stop and abstract. Generation removes the pain — and with it, the signal that told you to refactor.

Review degrades. When code arrives faster and "looks right," reviewers rubber-stamp more. The fast path is to approve, not to ask "should this exist at all?"

What this means for how you build

The counter-move isn't to ban AI — it's genuinely a productivity unlock. The move is to put the human effort where the model is weakest: structure.

  • Keep architecture decisions human and explicit. Boundaries, the data model, public interfaces, where state lives — these are the expensive-to-change decisions, and they're exactly what AI won't make well for you. Decide them deliberately, up front.
  • Treat AI like a very fast junior. Fantastic at filling in a well-defined function. Not the one you let define your module boundaries or your schema.
  • Make refactoring and de-duplication explicit review criteria. "Does this duplicate something we have?" and "does this belong behind an existing interface?" should be checklist items, not vibes.
  • Defend test coverage. Generated code without tests is the fastest way to build something nobody dares to touch in six months.
  • Watch churn as a signal. If lots of fresh code is being rewritten within days, that's not velocity — it's rework wearing velocity's clothes.

The architecture-first take

Here's the reframe. In a world where typing code was the bottleneck, "just write it" was a defensible default. Now that generating code is nearly free, the bottleneck moves entirely to the decisions code can't make for itself: what the system is, how its parts relate, what's allowed to depend on what. Those decisions were always the expensive ones. AI just stripped away the manual labor that used to hide how much they mattered.

So the studios and teams that win the next couple of years won't be the ones that generate the most code. They'll be the ones whose generated code lands inside an architecture good enough to absorb it — instead of turning into the 12-month rewrite the churn numbers are quietly predicting.

Use the AI. Keep the architecture human. That's the whole playbook.


I'm Anna Hartung, founder of H-Studio, an architecture-first engineering studio in Berlin. We spend a lot of our time making sure fast-moving code lands on a structure that can hold it.

Sources: GitClear AI Code Quality 2025 · devclass · arXiv 2512.11922

Top comments (0)