AI code is legacy code?
What Counts as Legacy Code?
- Strong disagreement with the slogan “all code is legacy.”
- One camp: code becomes legacy once business needs change, usually within a year or two; or as soon as it’s in production.
- Another camp: legacy is when no one understands or dares change it (authors gone, dependencies frozen, hard to modify).
- Other informal definitions: “code without tests,” “code that runs in production,” or “code you don’t simply change.”
- Naur’s “Programming as Theory Building” is invoked: legacy = code where the original mental model/theory is lost and only artifacts remain.
How AI-Generated Code Fits In
- AI tools are praised for boilerplate, mechanical refactors (e.g., i18n), test generation, and getting started in unfamiliar domains.
- They are criticized as “useless at solving problems” requiring design, user understanding, and nuanced tradeoffs.
- Concern that AI often picks “average” or outdated stacks/APIs, instantly creating near-legacy code.
- Some argue AI code is legacy from day one because the creator (the model) doesn’t share its reasoning like a human team; others counter that human reasoning is also opaque, while LLM conversations are at least replayable.
Best and Worst Practices for Using AI Coding Tools
- Recommended: treat AI like a junior pair-programmer; use it for small, reviewable changes, tests, docs, and scaffolding.
- Strong warnings against large AI-generated PRs and blindly accepting suggestions.
- Analogy to recreational drugs: useful in moderation by responsible users; dangerous when overused or by people without discipline.
“Living Code” and Fully AI-Driven Systems
- Speculation about “organic, self-healing code” where every request may follow a different generated path.
- Many push back: non-determinism, security, compliance, latency, and energy costs make this unacceptable for domains like banking.
- Some extrapolate to AI running all logic directly (no traditional programs), often satirically; others view it as “flying car thinking.”
Economic and Social Angles
- Legacy code is often the highest-earning code; calling AI code “legacy” might even sell it to management.
- Expectation that AI will create vast amounts of maintainable (and unmaintainable) code, plus new jobs maintaining AI-created systems.
- Worries about hyper-personalized, AI-mediated experiences eroding shared reality and deepening technodystopian trends.