Hacker News new | ask | show | jobs
by throwaway35784 2414 days 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.
3 comments

That's a good concrete example of bad comments. I suppose you could throw that in the "over-commenting" category.
And, 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.

This 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.
Yes it's an example of over commenting, which is exactly what the gp wanted.
This is instructive to new coders, on how NOT to comment.
That's what was asked for! Why on earth is the comment that properly delivers the expectation being discussed as though it's wrong?
I noticed the downvote and upvoted, plus acknowledged the anti-pattern. Sometimes intent is lost in text.