Andromxda 🇺🇦🇵🇸🇹🇼@lemmy.dbzer0.com to Programmer Humor@programming.devEnglish · 2 years agoHow programmers comment their codelemmy.dbzer0.comimagemessage-square17linkfedilinkarrow-up11arrow-down11file-text
arrow-up10arrow-down1imageHow programmers comment their codelemmy.dbzer0.comAndromxda 🇺🇦🇵🇸🇹🇼@lemmy.dbzer0.com to Programmer Humor@programming.devEnglish · 2 years agomessage-square17linkfedilinkfile-text
minus-squareMartin@feddit.nulinkfedilinkarrow-up1·2 years agoComments should explain “why”, the code already explains “what”.
minus-squarecalcopiritus@lemmy.worldlinkfedilinkarrow-up1·2 years agoInline comments yes. Function/Class/Module doc comments should absolutely explain “what”.
minus-squaresmeg@feddit.uklinkfedilinkEnglisharrow-up1·2 years agoThe allowable exception is when the what is a what the fuck, as in you had to use a hack so horrible that it requires an apology comment
Comments should explain “why”, the code already explains “what”.
Inline comments yes.
Function/Class/Module doc comments should absolutely explain “what”.
The allowable exception is when the what is a what the fuck, as in you had to use a hack so horrible that it requires an apology comment