title: What are examples of comments that tell you WHY instead of HOW or WHAT?
body: <p>First of all, in this question I'd like to stay away from the polemic on whether source code commenting is good or bad. I'm just trying to understand more clearly what people mean when they talk about comments that tell you WHY, WHAT or HOW.</p>
  
  <p>We often see guidelines like "Comments should tell you WHY; code itself should tell you HOW". It is easy to agree with the statement on an abstract level. However, people usually drop this like a dogma, and leave the room without further explanation. I've seen this used in so many different places and contexts, that it looks like people can agree on the catchphrase, but they seem to be talking about different things entirely.</p>
  
  <p>So, back to the question: if comments should tell you WHY, what is this WHY we are talking about? Is this the reason why that piece of code exists in the first place? Is this what that piece code should be doing? I would really appreciate if someone could give a clear explanation, and then add some good examples (bad examples are not really needed, but fell free to add them for contrast).</p>
  
  <p>Please do not immediately close this question as duplicate or polemic. I have tried hard to make it very objective. There are many questions on whether comments are good or bad, but no one that addresses the specific question of what are good examples of comments that tell you WHY.</p>
  
  <p>Thanks,</p>