If you don’t know or trust the author, you don’t know whether they’re correct. And if something doesn’t compile or there ends up being issues, you might have to read through the code more carefully to figure out what’s going on.
But if you don’t know or trust the author of self-documenting code, you can still run into the same issues. Comments are just another part of the code.
And no, I never trust the author - even if it was me 6 months ago.
Not to mention all the other programmers that might have fiddled with it. Not mention changes in the code since it was written, where the comments weren’t updated.
As a maintenance programmer with 35 years experience, the first thing I do is delete the comments. My experience says they get in the way and can’t be trusted. Read the code, understand the code, and figure why it’s doing what it’s doing. Don’t worry about what it might have been doing 10 revisions ago when the comments were last updated.
How do you know the comments are correct, or that they have been maintained along with the code over the years?
If you don’t know or trust the author, you don’t know whether they’re correct. And if something doesn’t compile or there ends up being issues, you might have to read through the code more carefully to figure out what’s going on.
But if you don’t know or trust the author of self-documenting code, you can still run into the same issues. Comments are just another part of the code.
Comments are by definition not part of the code.
And no, I never trust the author - even if it was me 6 months ago.
Not to mention all the other programmers that might have fiddled with it. Not mention changes in the code since it was written, where the comments weren’t updated.
As a maintenance programmer with 35 years experience, the first thing I do is delete the comments. My experience says they get in the way and can’t be trusted. Read the code, understand the code, and figure why it’s doing what it’s doing. Don’t worry about what it might have been doing 10 revisions ago when the comments were last updated.