How clean is your code?
22 May 2026
Bring your vacuum, feather duster and wipes because it's time for some clean code!
Why bother? As Martin Fowler so gracefully puts it:
Why bother? As Martin Fowler so gracefully puts it:
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
The classic MIT textbook "Structure and Interpretation of Computer Programs" emphasises that programs must be written for people to read, and only incidentally for machines to execute. Yet there's compelling argument to say that bad or messy code can do its job so why bother making it look pretty? Well, unless you're flying solo running your own codebase by yourself you're going to be collaborating with others who will read your code. And you'll be reading their code too. Without clean code it's like creating an unnecessary puzzle for your colleagues to solve every time they want to make a change to the codebase. Some of us like puzzles but maybe not that much! Anyone for an overly complicated 4D Captcha? I don't think so!
Principles first. There are tonnes of clean code principles that guide us towards looking out for our fellow colleagues. Here are three worth considering.
- Meaningful Names. What is a meaningful name? We're not talking about picking a name for your newborn — "hmm should it be Adam or Adrian?" What we're talking about is using meaningful names for variables, functions, and classes. A codebase with clear and descriptive names is easier to comprehend and maintain.
- Single Responsibility Principle (SRP). It helps when a class or function has only one job or responsibility. This is a boon for testability. It's much easier to write and maintain tests when there are clear responsibilities in code.
- Don't Repeat Yourself (DRY). In other words, don't introduce duplication. In other words, don't introduce duplication. Duplication is inefficient and a signal to the rest of your colleagues that the code isn't as well represented as it could be.
Clean Code in the world of AI. There's an economic argument that strengthens the case for clean code as a CEO quoted in a recent freeCodeCamp piece puts it:
"Abstract interfaces were challenging a few months ago just because they required twice as much code. But with AI, lines of code are free. The reason we still need such constructs is because at some point a human still needs to look at the code. Interfaces reduce the cognitive load."
The cost of creating code has collapsed yet the cost of reading it hasn't.
Speed up. Quality down. So does mega coding speed lead to shakey quality! Probably. As Ertuğrul Demir explains:
Google's DORA Report found AI adoption shows a negative relationship with software delivery stability. The 2025 report's central finding: "AI doesn't fix a team; it amplifies what's already there." Without robust control systems—strong testing, mature practices, fast feedback loops—increased AI-generated code leads to instability. Skills are exactly those control systems, encoded as instructions.
The truth. I'll leave you with this quote from Robert C. Martin.
"Truth can only be found in one place: the code."
Additional resources
- The Community's Guide to Testability
- Structure and Interpretation of Computer Programs
- clean_code.md
- How AI Changed the Economics of Writing Clean Code
- 2025 was the year of AI speed. 2026 will be the year of AI quality
- Skills, Not Vibes: Teaching AI Agents to Write Clean Code
Talking of clean code ...
- Is clean code a skill, a habit, or a discipline?
- Do you think bad code can still be good code if it works?
- How do you decide when code is "clean enough" to ship?
- Has AI-generated code made your codebase cleaner or messier?
- Which clean code principle do you find hardest to stick to, and why?
- What's the worst variable name you've ever encountered in a codebase?
- How do you maintain code quality when the speed of generation has gone way up?
Simon Tomes
Community Lead at MoTaverse
he/him
Hello, I'm Simon. Since 2003 I've had various roles in testing, tech leadership and coaching. I believe in the power of collaboration, creativity and community. 🎓 MoT-STEC qualified.
Sign in
to comment
Bring intelligent testing to every pull requests with autonomous static analysis and unit testing.
Explore MoT
See where AI genuinely helps, where it doesn’t, and how testers can stay firmly in control
Boost your career in software testing with the MoT Software Testing Essentials Certificate. Learn essential skills, from basic testing techniques to advanced risk analysis, crafted by industry experts.
Into the MoTaverse is a podcast by Ministry of Testing, hosted by Rosie Sherry, exploring the people, insights, and systems shaping quality in modern software teams.