Thoughts After Reading Clean Code
I finally finished reading Robert C. Martin's 'Clean Code'. I had high expectations since it's such a famous book, but I found it surprisingly difficult to apply many of its principles to actual work.
For example, the book says functions should be small, but in practice, I had no idea how to break down complex business logic. Honestly, I think 'Refactoring' was more practical.
However, the emphasis on coding conventions, reducing comments, and choosing good names really resonated with me. I plan to re-read it and consistently apply those lessons.
What do others think of this book? Has anyone tried applying it in practice?
6 answers
Agreed. Applying it in practice requires quite a bit of thought.
The Refactoring book is good, but Clean Code was also quite helpful.
But the clean code examples are way too simple, so they don't really match reality lol
I was also lost at first, but I think acknowledging the trade-off is important. Rather than unconditionally splitting functions into 10 lines or less, I practiced breaking them down by meaning, and it gradually got better. In particular, I made an effort to reduce nested if statements.
Tips for splitting functions: Extract conditional statements into separate methods or introduce a Value Object (VO) to make it easier. Additionally, designing a testable structure naturally leads to smaller functions. A recommended approach is to first write the large function, then identify patterns and refactor.
Well, I think Clean Code can sometimes be more harmful than helpful. Excessive abstraction actually reduces readability and leads to an unnecessary number of classes. Moreover, under real-world schedule pressure, there's no room to apply all of it, so the book's content often feels idealistic. Instead, I found cognitive science books like 'The Programmer's Brain' to be more useful.