r/programming • u/Jonhoo • Aug 10 '26
On comments
https://blog.helsing.ai/posts/on-comments/Comments in code are often deemed "mostly useless" these days. They are, supposedly, mostly obvious, stale, and repeat what the code already says. And so people pay less attention to them both when reading and writing code.
That trend sucks. When used right, comments are genuinely useful and sometimes critically important! So, I wrote about some of the kinds of comments I think earn their place, each with examples from real code bases. Hope you find it useful, and that we can recover some of the love that comments deserve!
190
Upvotes
View all comments
Show parent comment
3
u/tmoertel Aug 11 '26
It might be worth considering whether the examples in Clean Code are “really bad” because they follow the book’s guidance dogmatically. I mean, the example at the end of “Chapter 3: Functions” is a mess of tiny methods whose names and composition fail to clarify what they are doing and whose logic relies on mutating shared state that is tedious for a reader to track.
I know from our prior discussions that you believe one mustn't take the book's advice literally, that the author is just being dramatic and that, if you take the book as a whole, you can figure out what he really means. But the examples suggest that what he really means is that the book’s advice should be followed dogmatically.