How to comment your code better (particletree.com)

6 points by sudeepjuvekar ↗ HN
"Commenting your code is like cleaning your bathroom. You never want to do it, but it really does create a more pleasant experience for you and your guests... "

2 comments

[ 3.2 ms ] story [ 14.2 ms ] thread
Definitely try to write your code in self documenting form. A function name that makes it clear what the function does is better than a comment. Chances are comments start to rot very quickly as other programmers updating code are likely not to touch comments, or to copy and paste something and take a comment out context.
(comment deleted)