odama626@lemmy.world to Programmer Humor@programming.dev · 1 year agomemelemmy.worldimagemessage-square15fedilinkarrow-up1121arrow-down12
arrow-up1119arrow-down1imagememelemmy.worldodama626@lemmy.world to Programmer Humor@programming.dev · 1 year agomessage-square15fedilink
minus-squarebloubz@lemmygrad.mllinkfedilinkarrow-up5·1 year 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-up6·1 year 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·1 year 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-up1·1 year 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