Skip to content

Code Bloat

Summary

The tendency of AI-generated code to be excessively voluminous and complex, driven by the near-zero cost of code generation. Volume alone is a massive driver of complexity in software.

Root Cause

When generating code becomes almost free, the temptation is to generate far too much of it. AI produces 3-4x more code than humans writing manually, submitting fewer but larger pull requests with more content to review.

Why It Matters

  • Complexity driver — More code means more interactions, more edge cases, more things to understand
  • Review burden — Human reviewers must sift through huge chunks of AI-generated code
  • Maintenance cost — Every line of code is a liability that must be understood, tested, and maintained over the software's lifetime (most cost is post-launch)
  • Hides vulnerabilities — Larger codebases make it easier for security flaws to slip through

Research Findings

A study of 151 professional developers found that while AI didn't significantly damage maintainability, the risk of code bloat is one of two "slippery slopes toward disaster" identified by researchers (the other being Cognitive Debt).

Mitigation

  • Working in small batches
  • Solving one problem at a time
  • Highly modular designs that localize the blast radius for changes
  • Human review of generated code before committing
  • Teaching AI to be concise and minimal

See Also