@[email protected] to Programmer [email protected] • 9 months agoComenting codelemmy.mlimagemessage-square107fedilinkarrow-up11.2K
arrow-up11.2KimageComenting codelemmy.ml@[email protected] to Programmer [email protected] • 9 months agomessage-square107fedilink
minus-square@[email protected]linkfedilink6•9 months agoNot everything needs a comment - knowing when comments add value is the key… “what” vs “why” is usually a good indicator but some code just doesn’t need a comment.
minus-square@[email protected]linkfedilink3•9 months agoDoesn’t need any comment: int getCount() { return count; } Absolutely needs a very extensive comment: double getBojangleFlux { return fubar * .42; }
Not everything needs a comment - knowing when comments add value is the key… “what” vs “why” is usually a good indicator but some code just doesn’t need a comment.
Doesn’t need any comment:
int getCount() { return count; }
Absolutely needs a very extensive comment:
double getBojangleFlux { return fubar * .42; }