Hacker News new | ask | show | jobs
by jimfl 4960 days ago
Every line of code is a liability.

Every comment is also a liability, especially in light of the fact that the comment may, over time, drift away from the code. I sometimes wish I had an IDE that would color nearby comments red (and prevent commits) when code changes.

Which is to say, make comments where necessary, but own the liability, and strive to remove comments you find by making the code more obvious, just as you would strive to remove code to make it simpler.

If you want to record your intent, write a test.

Edit: accidentally a word.