Hacker News new | ask | show | jobs
by mook 686 days ago
Outdated comments are great, because it means you probably have a bug right there. If the comment didn't get updated, the code change probably didn't look at all the context and missed things.

Pretty sure I'm guilty of that pretty often.

1 comments

Looking at someone else's code, how would you know which was out of date, the code or the comment?
Does it matter? If the comment doesn't match the code, there's a bug (in the comment or the code). Either way you need to spend time to understand the context and figure out the correct thing, not trusting either.
Looking at the commit history is a great start. Especially if your team actually empowers people to reject code reviews when the commit messages are unclear or insufficiently detailed.
git blame will show when lines in a file were last changed, and the commit that changed them