Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Comments In Code.
> Code should be almost as readable as a book. You should be to read without pausing too much as well as skimming.
I pause much more reading code than I do reading prose.
Trying to keep a lookup table of functions and variables in my head is much harder than reading a few lines of prose to let me know what's going on.
Comments should summarise what's going on, so that when you have a bug, you can jump to the right section to change.
> Comments are almost like an annotation in a book. So use them sparingly.
The way I think of it: Don't use comments to annotate your code. Use code to annotate your comments.
There are no comments on this comment yet.
> Code should be almost as readable as a book. You should be to read without pausing too much as well as skimming.
I pause much more reading code than I do reading prose.
Trying to keep a lookup table of functions and variables in my head is much harder than reading a few lines of prose to let me know what's going on.
Comments should summarise what's going on, so that when you have a bug, you can jump to the right section to change.
> Comments are almost like an annotation in a book. So use them sparingly.
The way I think of it: Don't use comments to annotate your code. Use code to annotate your comments.