5 ms·
//increment i in for loop For (i=0;i++.... Var x; //define variable x X=4; //give value of 4 to x Everyone knows what that code does. The comments aren
by throwaway35784 7y ago
//increment i in for loop
For (i=0;i++....
Var x; //define variable x
X=4; //give value of 4 to x
Everyone knows what that code does. The comments aren't necessary.
- tchaffee 7y agoThat's a good concrete example of bad comments. I suppose you could throw that in the "over-commenting" category.
- throwaway35784 7y agoAnd, strangely, it's the only response to the gp's request to define of over-commenting, yet it is downvoted to below definitions of good commenting. So. Weird. The other responses didn't properly implement the requirement specification. I am so confused.
- loopz 7y agoThis is instructive to new coders, on how NOT to comment.
- throwaway35784 7y agoThat's what was asked for! Why on earth is the comment that properly delivers the expectation being discussed as though it's wrong?
- loopz 7y agoI noticed the downvote and upvoted, plus acknowledged the anti-pattern. Sometimes intent is lost in text.
- lostgame 7y agoThis is what I’m saying by over-commenting. I stated comments at the beginning of functions - what are the arguments? - what does it return - or at the beginning of class names are the wise go.
- throwaway35784 7y agoYes it's an example of over commenting, which is exactly what the gp wanted.