10 ms·
"At their best, comments in code are wasted effort." Surely the "why" for anything non-obvious should be written down just as much as the code shows the "what"
by stevesimmons 3y ago
"At their best, comments in code are wasted effort."
Surely the "why" for anything non-obvious should be written down just as much as the code shows the "what"?
Talking about comments as "wasted effort" sounds like you view them just as something added at the end to please a manager, rather a tool to help you write correct code in the first place.
- rufus_foreman 3y ago>> sounds like you view them just as something added at the end to please a manager, rather a tool to help you write correct code in the first place No, I've just worked for a long time where comments were required, and there was an effort in code reviews to make sure the comments were detailed and correct, and I've worked in a zero comment code base, and I don't see any difference. They just don't add value in my limited experience with one code base without comments for the last four years and with several code bases with comments for the 20 years before that. It was kind of surprising to me, but that's how it turned out. To be fair, the commits are associated with a JIRA ticket, and I can go that to figure out the "why". But I do that less than I would have expected also.