Hacker News new | ask | show | jobs
by kamjam 4925 days ago
But the point is that comments for that function are bad! They'll rot if you ever change the function or the assumptions at all

Do you leave unused functions in your code when you refactor? No. So refactor your comments, or delete them if they are no longer applicable, when you refactor your code.

I have been saved many times by comments in my own code, because you know I work on a lot of stuff, sometimes coming back to it after years and I hope I have developed as a coder and so my mindset is now different and a lot of the time I do wonder WTF was I doing here!

This is the opposite of your post http://tech.collectedit.com/post/2012/11/12/Comment-your-dam... which I tend to agree with a lot more.

Your code tells me what you did. Your comments tell me what you intended. Help me out. Help your future self out!