Hacker News new | ask | show | jobs
by ckdot2 1076 days ago
If code is wrong or out of date, the program will fail or stop doing that it's supposed to do. If comments are wrong or out of date, it will mislead the developer or at least confuse them if the comment says something else than the code. A wrong comment is worse than no comment - and usually developers don't care about comments as much as for the code. Why comment some code anyway if the code is easy to read? The only reason is to explain -why- something has been developed, not -how-.
1 comments

The identifier can become out of date. The common argument against comments is that they're an indicator that you should factor that block out into a function with a descriptive name, but I can say for certain that method names can easily become out of date. As for doing neither, well at the end of the day you probably do want a way to summarise a block of code to the next human, rather than requiring them to read every statement

Actually, speaking as someone's who's been generally critical of the "get AI to write our PRs!" thing, having an AI attempt a quick sanity check of comments near where your edits are could maybe work well