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

I tend to use my commit messages for things like this.


The advantage of having it in a comment vs in a commit message is that the source is immediately available to another developer browsing the code. Otherwise they will have to use git blame (or equivalent) to see why you did it that way.


The advantage of having it in a commit message vs a comment is that there's no chance of the comment just hanging around once it inevitably becomes irrelevant. Once it's irrelevant it's anti-productive to leave it in. Since there is no direct link between a comment and the code it applies to (it could be at the top of the function or class, for example), it's also really easy to forget removing it once it is no longer relevant.


Commits are forever, comments could be deleted by someone 'cleaning up'.




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

Search: