AI Joe
← Blog· AI Axiom

The Hidden Cost of AI's Favorite Interface

July 18, 2026

Ask an AI tool for a function that reads one config value and you may get an interface, a factory, a concrete class, and a schema. Nobody asked for a dinner suit to walk to the corner store, but that's what shows up.

This happens because of how these models learned to write code, and because of what looks finished to them.

The Details:

  • Training data skews toward ambitious, published codebases: systems built for scale, teams, and future extension. Nobody writes a case study titled "solved it in twelve lines." So the model's sense of quality code quietly becomes the sense of code that had something to prove, even when your problem never asked for that.

  • Ornamentation reads as completeness. A factory pattern announces itself as effort; fifteen clean lines that just work can look, to a pattern-matching system, like it didn't try hard enough. That bias pushes models toward interfaces for single implementations and factories that build exactly one object.

  • The real cost lands on every future edit, not on the first write. Change a retry timeout in an honest module and you touch one file. Change it in the over-engineered version and you tour an interface, a factory, an implementation, and a schema, four files to move one integer, repeated by every developer who comes after.

  • Abstraction earns its place only at genuine boundaries: the filesystem, the network, third-party APIs, anything you'll need to fake in a test within a week. Everywhere else, the working rule is to build the seam when the second real caller shows up, not when you imagine one.

The fix is behavioral, not architectural: ask for the plain version first, then delete anything that isn't paying rent. Developers who push back consistently, insisting on "no interface, no factory, just the function," train the tool toward leaner defaults over time. Restraint becomes a habit the model responds to.

Bottom Line: The best AI-generated code isn't what gets produced. It's what a disciplined developer strips away afterward.

Enjoy this article?

Listen to the Claude Code Conversations radio show or join the community.