The most important aspect of comments in code is to document the Why instead of the How. The How can be inferred from the code itself.
I disagree vehemently with people that hat say ‘code should document itself’ and then proceed to write no comments anywhere and pretend like their shit don’t stink.
The code is the only accurate description of what happens at runtime. Comment should give context or describe assumptions that the code makes about its environment. Nobody needs a comment telling that Request.getPath() returns the path of the request.
niggers
Sign posts and reminders to my future self when I revisit code weeks months years in the future.
Marginalia for Clojure.
Niggers