Video summary

Clean Code Revisited in the Age of AI - Danny Preussler | next app devCon 2026

Main summary

Key takeaways

Technology

Summary

Danny Preussler revisits the principles of Clean Code in a world where AI generates much of the code. His central point is that code quality still matters: developers may write less code themselves, but they still need to read, review, test, and maintain it. Code structure also affects how well an LLM can work with a codebase.

Clean Code Rules Through an AI Lens

  • Function arguments: Robert C. Martin’s preference for functions with few arguments arose partly from limitations in Java, where same-typed arguments can be hard to distinguish. Named arguments in languages such as Kotlin reduce that problem, so the rule is not universal.
  • Small functions: Preussler argues that extremely short, heavily chained functions can make it harder for an LLM to follow relationships across distant code. By contrast, single-purpose functions have a clear, predictable input-output relationship and are easier for models to understand and test.
  • Comments: Comments can explain intent, and AI tools may update them alongside code. But comments that excuse messy code or preserve obsolete information can steer a model toward poor patterns.
  • Commented-out code: Remove it. An LLM may still treat old, commented-out code as a meaningful example and reproduce it.
  • Vertical organization and locality: Organizing code from high-level details to low-level implementation may aid human reading. However, long files can expose models to the “lost in the middle” problem: details in the middle of a long context may receive less attention. Keeping related code close together can help.
  • Command-query separation: A function should generally either change state or return information, rather than do both. Preussler says mixing these roles can make a function’s meaning less predictable for a model.
  • Law of Demeter: Avoid long chains of calls. They require the model to understand multiple objects and can consume context; clear, local operations are easier to interpret.
  • Avoid over-abstraction: Don’t automatically extract similar-looking code into generic abstractions. If an abstraction hides what the code does or forces an LLM to jump between files, deliberate duplication may be clearer.

A Proposed AI-Oriented Principle

Preussler proposes a Single Context Principle: give an AI tool the relevant context together by keeping related code and concepts physically close. He recommends grouping by business function rather than only by technical layer, and keeping files manageable. He suggests roughly 300 lines as a useful scale, while warning that very long files become harder for models to follow.

He also stresses that the quality of the existing codebase matters. Dead code, outdated examples, and poor patterns can all influence generated output. Clear context and good examples improve the chances of useful results.

Testing and Quality Checks

Preussler argues that AI reduces the time-related excuse for not writing tests. He recommends using AI to generate tests and then checking them with mutation testing: deliberately change source code and confirm that the tests detect the changes.

He also describes the CRAP index, which combines test coverage with cyclomatic complexity. Coverage alone can be misleading; complex code needs stronger tests. The metric can help identify risky code for AI-assisted refactoring.

Key Takeaway

Many Clean Code ideas remain useful, but they should be applied with attention to how AI tools use context. Preussler’s practical advice is to keep code and context clear, remove misleading or obsolete material, favor understandable local structure, and use tests and quality metrics to evaluate AI-generated changes.

Main Speakers and Sources

  • Danny Preussler — Main speaker and source of the analysis and recommendations.
  • Robert C. Martin (“Uncle Bob”) — Referenced through Clean Code and a video excerpt quoted during the talk.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video