Written by: Mark Hull, Co-Founder and CEO, Exceeds AI | Last updated: September 2, 2026
Key Takeaways
- Clean Code’s core values of readability and maintainability still matter, and its rules work best as flexible heuristics.
- AI-generated code introduces measurable technical debt, with high rates of code smells and duplication across repositories.
- Over-application of Clean Code principles can create shallow modules and lasagna code that increase complexity.
- This article distills five enduring principles that remain relevant when applied contextually to AI-generated code.
- Exceeds AI gives engineering teams line-level visibility and outcome tracking to apply clean code principles effectively at scale in the AI era. See how Exceeds AI works.
The Problem: Dogma, Backlash, and AI-Driven Debt
When Clean Code Becomes Dogma
The backlash against Clean Code is well-documented and comes from credible sources. Dan Abramov’s “Goodbye, Clean Code” describes a refactor that traded a team’s ability to change requirements for less duplication. That trade hurt the team. Casey Muratori’s “Clean Code, Horrible Performance” benchmarked Martin’s examples against straightforward implementations and found the clean versions running up to 23 times slower. qntm’s essay questions whether rules like “boolean arguments are bad” apply universally at all.
The community has named specific failure modes. Over-decomposition produces what Hacker News commenters have called “lasagna code”, where layers are so thin that tracing a single request requires opening a dozen files. John Ousterhout, Stanford professor and author of A Philosophy of Software Design, calls these “shallow modules”: large, complex interfaces that hide very little actual work. He argues that decomposing code into micro-functions does not eliminate complexity. It relocates complexity to the connections between pieces.
Martin himself, in a joint public discussion with Ousterhout held between September 2024 and February 2025, conceded about his small-function rule: “This is not an assertion that I can justify.” That admission from the book’s author signals that the rules always worked as heuristics. They were never universal laws.
The New Challenge: AI-Generated Code
AI-generated code compounds the dogma problem. A 2026 large-scale empirical study analyzing 302,600 verified AI-authored commits from 6,299 GitHub repositories found 484,366 distinct issues in AI-generated code, with code smells accounting for 89.3% of all issues. Worse, these problems are pervasive and persistent. More than 15% of commits from every AI coding assistant introduce at least one issue, and 22.7% of those issues persist at the latest version of the repository, accumulating as technical debt.
GitClear’s analysis found code churn rising from 4.5% in 2023 to 5.7% in 2024, refactoring down 39.9%, and copy-pasted lines up 17.1%. A separate GitClear analysis of 623 million code changes found duplicated code blocks rose from 40.3 per million changed lines in 2023 to 73.0 in 2026. During the same period, moved code, which signals real refactoring, fell from 21% to 3.8%.
AI produces code that looks clean. It is syntactically polished, conventionally formatted, and locally plausible. That surface quality creates risk. Ninety-six percent of developers do not fully trust AI-generated code is functionally correct, yet only 48% always check it before committing. The old clean code rules were not designed for a world where a significant portion of every PR is written by a model that optimizes for syntactic correctness rather than semantic fit. Given these new pressures, teams need to update how they apply clean code principles instead of discarding them.
The Solution: A 2026 Update on Clean Code Principles
Clean code still matters. The core values of readability and maintainability remain timeless. What needs updating is the relationship between those values and the specific rules used to support them. A 2026 practical guide frames this correctly. The evolution of clean code reflects a change in implementation, not a rejection of principles.
Five Principles That Still Work in 2026
- Meaningful Names. Code should be self-documenting at the identifier level.
getActiveUserCount()communicates intent more clearly thanusrCnt(). Naming is the highest-leverage clean code skill because a precise name removes the need for a comment, a lookup, and often an entire explanation. This matters even more for AI-generated code, which often produces generic names likeprocessData()orhandleRequest()that describe the prompt instead of the domain. - Single Responsibility Principle (SRP). A function or class should have one reason to change. Here, “reason” means a stakeholder who can request a change, not simply “does one thing.” Most failed SRP refactors split classes by technical layer rather than by change axis. That pattern creates ceremony without reducing the cost of change. A practical test asks whether the last five non-trivial changes to this class came from the same stakeholder for the same reason.
- Don’t Repeat Yourself (DRY). Duplication signals risk, yet premature abstraction often causes more harm. A practical rule is to duplicate until the third occurrence, and extract only when the copies have changed together for the same reason at least once. Similar-looking code does not always share a purpose. Duplication is cheaper than a wrong abstraction because wrong abstractions become load-bearing walls.
- Boy Scout Rule. Leave the codebase cleaner than you found it. This principle gives teams a practical tool for managing technical debt incrementally in a large, fast-moving codebase. Applied consistently, it prevents the accumulation of the kind of hidden debt that AI-generated code is empirically shown to introduce.
- Readability. Code is read far more often than it is written. In commercial environments, code is read ten times more often than it is written. Neglecting structural clarity leads to technical debt, velocity drops, and multiplied defect remediation costs. In the AI era, this principle also applies to LLMs. LLMs process code via an attention matrix where proximity is power. Poorly structured code with variables used far apart increases hallucination risk.
Where the Original Book Falls Short
Dogmatism. Rules applied without context become counterproductive. Software teams often treat programming advice as doctrine before verifying it against their own code and context. This pattern appears most often for junior engineers, who receive Clean Code as a senior-endorsed text and hear it cited in reviews and interviews. That dynamic turns one programmer’s preferences into a rulebook. The book’s confident, preachy tone, which frames non-adherents as unprofessional, amplifies this effect.
Over-Abstraction. The obsession with tiny functions and interfaces leads directly to what Ousterhout calls shallow modules. Forcing artificial abstractions creates large, complex interfaces that do very little actual work underneath. A practical diagnostic helps here. If tracing one user request opens more than seven files, or if adding a field requires editing five DTOs and three mappers, then the codebase has been over-engineered. In major technology companies, flat, direct code that prioritizes execution speed and low cognitive overhead is the norm. Layered abstraction hierarchies from dogmatic clean code often work against that goal.
Short-Function Obsession. Arbitrary line limits harm both performance and readability. Every tiny function causes a context switch, and every abstraction adds a layer to understand. Clean code in that style moves complexity instead of reducing it. A practical 2026 target is functions under 20 lines, with a split recommended over 50. Martin’s examples sometimes imply a two-to-four-line target. A better measure asks whether the function’s name fully describes what it does, rather than whether it fits an arbitrary line count.
How to Apply Clean Code to AI-Generated Code
Make AI Contributions Visible
Teams need visibility before they can apply clean code principles to AI output. Without line-level provenance, engineering leaders cannot answer basic questions about AI-generated code. They do not know which lines in a PR were AI-generated, which tool produced them, or whether the engineer reviewed them before merging. AI already writes 42% of committed code, with developers expecting 65% by 2027. Most organizations still lack a systematic way to identify which lines those are.
Exceeds Ink’s line-level provenance makes AI contributions visible. Every commit carries a structured attestation that includes tool, model, session, interaction mode, and timestamp. Exceeds writes this data as a Git Note that lives in your own repository, portable and auditable. That visibility becomes the prerequisite for applying any clean code principle to AI output. Teams cannot review or refactor what they cannot see. To see AI contributions line by line, book a demo with Exceeds AI.
Track Long-Term Outcomes
Teams need outcome metrics, not vanity metrics. Lines of code, acceptance rates, and PR velocity do not answer the key question about AI-generated code. Leaders need to know whether this code becomes a long-term asset or a liability. A 2022 quantitative study of 39 proprietary production codebases found that low-quality code leads to 15 times more defects and takes 124% more time to resolve. AI code often passes initial review before its quality problems surface.
Exceeds AI tracks the long-term health of AI-generated code and connects it to incident rates and rework patterns over 30 or more days. When a team at a 300-engineer software company used Exceeds, they discovered within the first hour that GitHub Copilot contributed to 58% of all commits with an 18% productivity lift. Deeper analysis revealed rising rework rates. Ink’s interaction-mode classification identified that the problematic commits were predominantly agent mode without a plan phase. That pattern was coachable. Rework rates began correcting within two sprints after the team adopted ink-prompting-coach. To track AI outcomes over time, schedule a walkthrough of Exceeds AI.
Coach Engineers on Better AI Prompts
Deliberate practice, not tooling alone, drives safer AI usage. The 2025 Stanford study found that developers using AI assistants and specifically prompted to review for security issues had vulnerability rates comparable to unassisted developers. The difference came from how they worked. The same pattern applies to clean code. The quality of AI output depends on how engineers prompt and review, as well as which tool they use.
Exceeds AI’s Best Practices Insights distill your team’s actual AI-coding patterns into the top skills worth scaling, sorted by confidence. Coaching Surfaces turn that data into action. They identify which AI usage patterns lead to clean, maintainable code and distribute those practices across the organization. The goal centers on data-driven coaching that helps engineers improve. Engineers receive personal insights and AI-powered guidance inside the tools they already use. To see these coaching workflows in practice, request an Exceeds AI demo.
Exceeds AI: Visibility and Analytics for Clean Code in the AI Era
Modern clean code practice needs both principles and observability. In 2026, a significant and growing share of every codebase is AI-generated, and the empirical evidence shows that AI code introduces technical debt at measurable rates. The principles above provide the framework. Exceeds AI provides the visibility and analytics to apply them at scale.
Exceeds AI is an AI-Impact analytics platform. It gives engineering leaders code-level proof of AI ROI and provides engineering managers prescriptive guidance to scale adoption. At its core is Exceeds Ink, the on-machine provenance layer that captures AI authorship across Cursor, Claude Code, Codex, GitHub Copilot, and Windsurf with line-level fidelity. It writes a portable attestation alongside every commit as a Git Note.
Traditional engineering analytics platforms such as Jellyfish, LinearB, and Swarmia track PR cycle times and commit volumes. They remain blind to which lines are AI-generated. Exceeds analyzes code diffs at the commit and PR level to distinguish AI from human contributions. That distinction forms the foundation for every other capability.
Key capabilities relevant to clean code in the AI era include:
- AI Usage Diff Mapping: See exactly which lines in a PR were AI-generated and by which tool, including Cursor, Claude Code, Copilot, or others, down to the line level.
- AI vs. Non-AI Outcome Analytics: Compare the long-term outcomes of AI-touched code versus human code across cycle time, defect density, rework rates, and incident rates 30 or more days later.
- Longitudinal Outcome Tracking: Monitor AI-touched code over 30, 60, and 90 days to identify hidden technical debt before it becomes a production crisis, matching the failure modes documented in 2026 empirical research.
- Coaching Surfaces: Get actionable insights and distribute best practices to teams to improve AI prompting and code review skills, delivered directly into the developer’s own Claude Code or Cursor agent via ink-prompting-coach.
To explore these capabilities in your own environment, book a tailored Exceeds AI demo.
Frequently Asked Questions
Is Clean Code worth reading?
Clean Code is worth reading with a critical eye. It is a foundational text that taught many engineers to value readability and maintainability at a time when those conversations were less common. Its core message, that code is read far more often than it is written and should be written accordingly, remains sound. Its specific rules work best as heuristics instead of laws. The function-size rules, the anti-comment stance, and the abstraction prescriptions all require contextual judgment. Pairing it with John Ousterhout’s A Philosophy of Software Design provides a more balanced view. Clean Code focuses on what to do, while Ousterhout explains why complexity accumulates and how to fight it with information hiding and deep modules.
What are the five principles of clean code?
The five principles with the most enduring relevance are: (1) Meaningful Names, (2) the Single Responsibility Principle, (3) Don’t Repeat Yourself (DRY), (4) the Boy Scout Rule, and (5) Readability. Meaningful Names make code self-documenting at the identifier level. SRP, correctly understood, focuses on change axis, so a class has one stakeholder who can request changes, rather than simply “doing one thing.” DRY works best with the Rule of Three: abstract only after the third occurrence of a pattern, and only when the copies have changed together for the same reason. The Boy Scout Rule, which encourages leaving the codebase cleaner than you found it, offers a practical tool for managing technical debt incrementally. Readability remains the overarching principle, and the reading-to-writing ratio mentioned earlier only increases when AI generates a significant share of the codebase.
What are the criticisms of Clean Code?
The main criticisms fall into three categories. First, dogmatism, where the book’s confident, prescriptive tone encourages engineers to apply its rules without contextual judgment and turns heuristics into laws. Second, over-abstraction, where the emphasis on tiny functions and interfaces can produce shallow modules with high structural complexity but little actual logic per file, making codebases harder to navigate. John Ousterhout’s work directly addresses this failure mode. Third, the short-function obsession, where arbitrary line limits can harm both performance and readability. The performance benchmarks mentioned earlier highlight this risk. Robert C. Martin himself conceded in a 2024–2025 public discussion that his small-function rule is “not an assertion I can justify.”
Does clean code still matter in the age of AI?
Clean code matters more than ever in the age of AI. The core values of readability and maintainability remain timeless, and the empirical evidence from 2026 strengthens the case. A large-scale study of 302,600 AI-authored commits found the 89.3% code smell rate mentioned earlier, and 22.7% of those issues persisted at the latest version of the repository. GitClear’s analysis shows copy-pasted lines rising sharply while real refactoring collapses. AI generates code at unprecedented speed. Without clean code principles applied systematically to that output, through meaningful naming, SRP, DRY with judgment, and the Boy Scout Rule, technical debt accumulates faster than any team can address manually. The principles still work. The tools for applying them need to match the AI era.
Conclusion
Rigid, dogmatic application of Clean Code’s 2008 rules fails modern teams. The criticisms from Dan Abramov, Casey Muratori, John Ousterhout, and the broader engineering community highlight real problems. Arbitrary function-size limits, premature abstraction, and rules applied without context produce over-engineered, harder-to-maintain codebases. Robert C. Martin has acknowledged that his most famous rule cannot be justified.
The core values behind Clean Code, including readability, maintainability, and intentional design, matter even more in 2026 than in 2008. A 2022 study found that low-quality code leads to 15 times more defects and wastes up to 42% of developer time. AI-generated code, which now accounts for a significant and growing share of every codebase, introduces code smells at measurable rates and accumulates technical debt that often surfaces 30 to 90 days after merge. The principles remain sound. The dogma does not.
A pragmatic, modern approach to clean code applies the five enduring principles, Meaningful Names, SRP, DRY with the Rule of Three, the Boy Scout Rule, and Readability, as contextual guidance rather than universal law. It pairs that framework with the visibility to see which lines are AI-generated, track their long-term outcomes, and coach teams to improve. Exceeds AI provides that support through code-level provenance with Exceeds Ink, outcome analytics that connect AI usage to quality metrics over time, and coaching surfaces that turn data into action.
Ready to bring clean code principles into the AI era in a measurable way? Book a demo with Exceeds AI today and see your AI-generated code clearly.