Hacker News new | past | comments | ask | show | jobs | submit login

I mostly like a comment with a succinct explanation and a longer commit message. Comments are less likely to be refactored and lose the immediate git blame, while the function might change over time.

Ideally the future user would trace the git blame back to the original commit of they really had questions.

A long comment is really helpful sometimes though. I like to put ascii truth tables for complex boolean logic, both to ensure I cover all cases when writing the code (tests, too) and to make it easier for future me to understand what's going on at a glance.




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

Search: