News for hackers. Stuff that matters.
Re:Writing Well-Documented Code – Learn from Examples by ainzzorl on Saturday September 04, 2021 @01:27PM (#28417048)
I agree that some comments in the first example are unnecessary, e.g. the one pointed out in [0], but I find comments like that at worst useless, but not harmful. They have a potential to become harmful if someone updates the code but doesn't bother to update the comment, but I can't see how it takes away the ability to scan the code.

[0]: https://news.ycombinator.com/item?id=28416777

Re:Writing Well-Documented Code – Learn from Examples by Lio on Saturday September 04, 2021 @01:48PM (#28417300)
It’s tricky, I think I remember reading a paper by Microsoft research (I’m really sorry; looking for a source) that showed a correlation between bugs and all lines of code including comments.

So if that’s true redundant comments do hurt you.

Anecdotally in dynamic languages incorrect comments related to types seem to be a constant pain for me. They’re unverified and so a second source of truth that often wrong and can’t be trusted.

Re:Writing Well-Documented Code – Learn from Examples by Rapzid on Saturday September 04, 2021 @04:04PM (#28418577)
> correlation

> So if that’s true redundant comments do hurt you

Anyway, even if there was causation proven it might need to be weighed against other priorities.