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

I actually comment even simple code because comments show up a different color in my editors. Comments for me are often an additional mnemonic trigger rather than necessarily a store of detailed information. It's like indenting or bolding text. It helps with "chunking" while skimming code.


The trouble is that the very same visual cue makes it easy to filter out comments as background noise, so people fail to read them (or even see them) when updating the associated code. As a result, comments don't get maintained and become inaccurate over time. It takes only a small amount of such semantic decay before the comments are a net negative.

Programmers take code seriously. Most don't take comments seriously, even when they believe they ought to. You might say they're bad programmers, but I don't think it's that simple. I think the attention goes straight to code for a reason.


For this purpose, whitespace is a much better tool than blocks of lorem ipsum.

Braces (in relevant langauges, like C and Java) are even better, because they tighten scoping and avoid unintentional variable re-use.




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

Search: