3 ms·
To me, this is a terrible example, because it's a useless comment. The comment should explain what "x" is for, not what you're doing to it. I you have a comment
by falcolas 13y ago
To me, this is a terrible example, because it's a useless comment. The comment should explain what "x" is for, not what you're doing to it. I you have a comment about what "x" is for, which becomes more important? The assignment, or the explanation?
- peeters 13y agoIf you have to explain what x is for with a comment, maybe x is a bad name in the first place?
- falcolas 13y ago"x" is not always something which can be easily or fully explained in one to four words. And anything over four (short) words is typically getting too cumbersome as a variable name.
- noonespecial 13y agoShrug. Most of the code I have to deal with regularly is primarily commented with profoundly unhelpful, often blatantly incorrect nuggets such as this. Forever what and never why. It seems better if it just faded into a fossilized archeology that only needed to be Gandalfed in the most dire circumstance. In my situation, making the comments "stand out so that people will make better ones or fix them" seems optimistic to the point of being naive. We may in the end be down to the old "what should be" vs "what is".