Usually it's not that the comment is written wrong, but that the code changes over time and the comment isn't updated to reflect that. I'm sure somebody will argue "well don't do that", but that doesn't really reflect the reality of the situation most of the time.
Usually if the code is self descriptive it's better because then it's an atomic operation. As the code changes the high-level descriptor of what that code is doing also changes (hopefully anyways).
Either way, my point isn't to defend or oppose the article, but just to point out that incorrect comments are a very real problem on projects.
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
Usually it's not that the comment is written wrong, but that the code changes over time and the comment isn't updated to reflect that. I'm sure somebody will argue "well don't do that", but that doesn't really reflect the reality of the situation most of the time.
Usually if the code is self descriptive it's better because then it's an atomic operation. As the code changes the high-level descriptor of what that code is doing also changes (hopefully anyways).
Either way, my point isn't to defend or oppose the article, but just to point out that incorrect comments are a very real problem on projects.
exactly . comments are dead. Code is alive