3 ms·
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 al
by mook 2y 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.
- irthomasthomas 2y agoLooking at someone else's code, how would you know which was out of date, the code or the comment?
- Vegenoid 2y agogit blame will show when lines in a file were last changed, and the commit that changed them
- mook 2y agoDoes 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.
- mumblemumble 2y agoLooking 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.