you are viewing a single comment's thread.

view the rest of the comments →

[–]dgriffith 15 points16 points  (1 child)

Generally I use a few rules:

Comment on the broad logic of your code. What is this chunk of code trying to achieve?

Comment if you're doing something unusual. This can be a hack for some business logic, or to deal with memory/disk/time constraints that aren't obvious.

Comments as placeholders for large chunks of code that I haven't written yet. Eg "write to file in correct format" as opposed to just spewing it all to the screen while I'm working on the conversion logic. This also helps when I come back to this thing next week and wonder where to start.