odama626@lemmy.world to Programmer Humor@programming.dev · 1 year agomemelemmy.worldimagemessage-square17fedilinkarrow-up1144arrow-down12
arrow-up1142arrow-down1imagememelemmy.worldodama626@lemmy.world to Programmer Humor@programming.dev · 1 year agomessage-square17fedilink
minus-squarebloubz@lemmygrad.mllinkfedilinkarrow-up7·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-up7·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-up1·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-up2·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