Apr 06, 2025 · Software Design
It's Probably Time to Stop Recommending Clean Code
Robert Martin's "Clean Code" has been the default recommendation for new developers for over a decade. It shaped how an entire generation thinks about naming, functions, and code organization. But after years of applying its principles in production systems, I believe we need a more nuanced conversation about its advice.
The book's emphasis on small functions — sometimes as small as 2-3 lines — often leads to code that's harder to follow, not easier. When a simple operation is split across seven tiny methods, you spend more time navigating the call stack than understanding the logic. Readability isn't about function length; it's about cognitive load.
Clean Code also promotes an almost religious adherence to abstraction that can be counterproductive. Not everything needs an interface, a factory, and a strategy pattern. Sometimes a well-written procedural function is the clearest, most maintainable solution. The YAGNI principle (You Aren't Gonna Need It) often conflicts directly with Clean Code's advice.
That said, the book gets important things right: meaningful naming, single responsibility at a high level, and the importance of tests. The problem isn't the book itself — it's treating it as gospel rather than one perspective among many. Recommend it alongside "A Philosophy of Software Design" by John Ousterhout for a more balanced education.