odama626@lemmy.world to Programmer Humor@programming.dev · 2 years agomemelemmy.worldimagemessage-square17fedilinkarrow-up1131arrow-down12
arrow-up1129arrow-down1imagememelemmy.worldodama626@lemmy.world to Programmer Humor@programming.dev · 2 years agomessage-square17fedilink
minus-squarebloubz@lemmygrad.mllinkfedilinkarrow-up6·2 years agoComments should almost always be reserved to “why” and not “what” or “how”. Give extra context that can not be brought in another way. The rest should be clear from the code
minus-squaresimple@lemmy.mywire.orglinkfedilinkarrow-up7·2 years agoMy “why” comments: // This is here because if I remove it, the whole server panics, no idea why. So don't delete it.
minus-squareDeebster@lemmyrs.orglinkfedilinkEnglisharrow-up0·2 years agoI upvoted this, but actually I hardly ever see this style of commenting. Maybe it’s because I never got very far into corporate coding.
minus-squareDarorad@lemmy.worldlinkfedilinkEnglisharrow-up2·2 years agoAt least in my experience it’s more people just stop leaving comments. Best place I worked had comment review as a part of code review, that was nice
Comments should almost always be reserved to “why” and not “what” or “how”. Give extra context that can not be brought in another way. The rest should be clear from the code
My “why” comments:
// This is here because if I remove it, the whole server panics, no idea why. So don't delete it.
I upvoted this, but actually I hardly ever see this style of commenting. Maybe it’s because I never got very far into corporate coding.
At least in my experience it’s more people just stop leaving comments. Best place I worked had comment review as a part of code review, that was nice