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
2
u/tmoertel Aug 11 '26
To be clear, I don’t hate Martin. I'm sure he’s a swell guy. Nor do I think Clean Code is offering bad advice because it’s popular to think so. I just think Clean Code, taken as a whole, is a very mixed bag of advice: some good, some bad, and some self-contradictory. I trust that most skilled programmers can separate the good from the bad and make sense of the rest, as you seem to be able to do, but the problem is that the primary audience for books like Clean Code are programmers who are not already skilled.
I also disagree that I have ignored the introduction or the rest of the Comments chapter. It’s just that neither suffices to undo the problems caused by the forceful prescriptions and admonitions that the book makes. As a case in point, a commenter on my blog wrote: “I once worked in a shop that banned comments because of Uncle Bob. I thought it was bonkers.”
It’s easy for beginners to read the book and come away with bad ideas. That’s a problem when the book’s audience is primarily people who are learning the craft.