Hacker News new | past | comments | ask | show | jobs | submit login

I had some thoughts on this just a couple weeks ago, in which I outright said I think most code comments are harmful: https://twitter.com/eyelidlessness/status/144409690913665434...

That said, I don’t think barring comments would be helpful. As you described, presence/frequency of comments tends to diminish as code quality improves. More, clarifying what I put in the tweet thread: quality of comments tends to improve and reliance on low quality comments tends to drop.

But that’s a correlation with other positive factors. Enforcing that a hypothetical low quality code author cannot include comments won’t convey all of the other factors that would help them improve the code they write. It’ll just make their low quality code more opaque.

A better approach, in my opinion, is to treat comments as code smells in review/maintenance tasks. You can use this as an opportunity to interrogate the comments directly, and discuss the commented code secondarily. This gives you a chance to express, here’s an approach that might not need explanation at all.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact