Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why I comment:

When I'm learning a language I write comments for myself. Notes about syntax, idioms, gotchas, and whatever else.

When I'm fixing a problem I leave XXX markers around to easily keep track of what I'm doing.

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.

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: