Re:Don't use comments, use code
by ThePadawan on Friday September 03, 2021 @03:26PM
(#28408300)
The author gets so close to the productive answer regarding TODOs, it's frustrating to see the conclusion be "...so never add TODO comments at all."
So what, after creating the issue for the future, the person implementing it has to start over navigating the code?
And the next person working on the code (who might not know about that issue) might stumble across the same obstacles as the original author who went on to file the issue?
I think in any multi-programmer project, the bidirectional link code<->issue needs to exist.
Why is a perfectly good reason to write comments.
The only reason it's even controversial is code with "what?" comments, those just pollute the codebase (a little bit of high level what comments are sometimes Ok).
This propagates to all other advice in this article.
Magic numbers? Comments can be good be useful if they answer "why"
TODOs? Comments can be good if they answer "why" (as in, "why haven't this been done yet) After-update notes? If the action is optional, make it a comment -- this will make upgrading to latest version easier.