5 ms·
> If it's a complicated algorithm, a veteran programmer wants to see the whole thing on the screen, which means reducing the number of blank lines and inline co
by DanBC 15y ago
> If it's a complicated algorithm, a veteran programmer wants to see the whole thing on the screen, which means reducing the number of blank lines and inline comments – especially comments that simply reiterate what the code is doing.
Don't text editors have, along with syntax highlighting, any "hide comments" and "compress whitespace especially blank lines" features?
- __david__ 15y agoPossibly, but those are actually kind of dangerous, because if you have the comments hidden and you are editing the code you probably aren't updating the comments. And stale comments are worse than no comments.
- ajross 15y agoAbsolutely true. But your assumption that people being able to read comments means that they'll update them seems awfully naive. Comments become lies over time. They always do.
- __david__ 15y agoI didn't mean to imply that and I completely agree with you. I'm not a huge commenter myself--my general rule is only comment what is weird or un-obvious and make the code readable with good function and variable names.