3 ms·
"How, what, why" Use code for describing how your program does what it does, function-level comments for what it does in cases where you cannot put that in the
by Someone 12y ago
"How, what, why"
Use code for describing how your program does what it does, function-level comments for what it does in cases where you cannot put that in the name of a type or identifier (getFoo typically does not need a comment, but strtok does) and sprinkle in comments why your program does what it does in the way it does where that may not be clear to the expected reader of your code (as in the example of the AVL tree in a sister comment)