Beyond "Clean Code": Why Your Comments Matter
chmaynard
11 points
4 comments
July 27, 2026
Related Discussions
Found 5 related stories in 62.1ms across 6,164 title embeddings via pgvector HNSW
- Maybe We Shouldn't Be Reviewing All This Code ingve · 40 pts · September 02, 2026 · 58% similar
- Reviewing code you didn't write colescodes · 14 pts · July 22, 2026 · 56% similar
- Better AI code comment detector ibobev · 40 pts · September 09, 2026 · 55% similar
- How to Write Unmaintainable Code (2015) theanonymousone · 18 pts · July 17, 2026 · 53% similar
- Software Engineering fundamentals matter more ingve · 66 pts · August 15, 2026 · 52% similar
Discussion Highlights (3 comments)
blinkbat
I disagree that it's the codebase's job to communicate product's intent
johnmwilkinson
I completely agree. I wrote a book on the subject of how to write clear code (Bob Martin was off by one letter!) and comments are a key element of that. https://elementsofcode.io/chapters/documentation/ We’re in good company: Jon Ousterhaut had a conversation with Uncle Bob where he brings up the exact passage you quote as a point of disagreement.
magicalhippo
I reached the same conclusion. Yes, absolutely let the code be self-documenting by structuring it well, using well-named functions and variables and so on. This will make it clear what you're trying to do. So yes, you shouldn't write "check if greater than two" in a comment, that should be obvious from the code itself. But sometimes the why is very important, and it is not readily obvious from the what . Ideally try to modify the code so it becomes clear. Don't just check against two, check against a named constant that provides information through the name. However what can be more difficult to express cleanly is for example why the check is being done here and not somewhere else, in the cases where that matters. In those cases, help the reader by adding some clarifying comments as to why this is being done.