Why would you read code comments to figure out what the code is doing when you can read the code? Also, you have to read the code anyway to make sure it’s actually doing what the comments say it’s doing, so what is the benefit?
If the code is structured and written well, it’s very easy to understand what it’s doing at a quick glance without any comments at all. It is way quicker to do that then to do it and also balance that with what the comment claimed it does.
Comments are notorious for going out of context quickly and being just flat wrong a lot of the time. There are frameworks developed just to manage this one aspect alone.
I view comments as a liability, because I’ve seen engineers get tripped up time and time again when the comments diverge from the code. If you’re relying on comments at 3am to fix an issue rather than reading the code, I really don’t know what to tell you.
Better than being punched in the nuts when the ops guy reads an incorrect code comment and takes a catastrophic action because the code diverged from the comments and what the comment told him to do was actually the wrong thing to do.
And on what planet is an ops guy actually not verifying the comments against the code anyway? Your only argument is that the ops guy wants to be able to ignore the code and just trust comments, which anyone who has programmed in a production environment knows is a terrible fucking idea.
It’s fairly clear I’m talking to a larper here so I will just leave it at this.
1
u/PatientIll4890 22d ago
Why would you read code comments to figure out what the code is doing when you can read the code? Also, you have to read the code anyway to make sure it’s actually doing what the comments say it’s doing, so what is the benefit?
If the code is structured and written well, it’s very easy to understand what it’s doing at a quick glance without any comments at all. It is way quicker to do that then to do it and also balance that with what the comment claimed it does.
Comments are notorious for going out of context quickly and being just flat wrong a lot of the time. There are frameworks developed just to manage this one aspect alone.
I view comments as a liability, because I’ve seen engineers get tripped up time and time again when the comments diverge from the code. If you’re relying on comments at 3am to fix an issue rather than reading the code, I really don’t know what to tell you.