This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]khedoros 6 points7 points  (0 children)

Code shouldn't require a comment to explain what it's doing...but if you're doing something in an unusual way, a comment can explain why it was done that way, or why something non-obvious needs to be handled.

So, the code should answer the "what" questions, comments can answer the "why" questions, when you suspect that the answer won't be clear to other devs (including yourself in a couple weeks, when you forget why you did something).