Why I comment:<p>When I'm learning a language I write comments for myself. Notes about syntax, idioms, gotchas, and whatever else.<p>When I'm fixing a problem I leave XXX markers around to easily keep track of what I'm doing.<p>When I'm writing maintenance code I reference the ticket number, describe the problem or feature, and why we implemented the fix or feature the way we did.<p>You should never see the first two types of comments in checked in code, but I bet that I've probably saved later maintenance programmers hours of frustration with that last type of comment.