602
No comment
(lemmy.nz)
Related Communities !programmerhumor@lemmy.ml !programmer_humor@programming.dev !programmerhumor@kbin.social !programming_horror@programming.dev
Other Programming Communities !programming@beehaw.org !programming@programming.dev !programming@lemmy.ml !programming@kbin.social !learn_programming@programming.dev !functional_programming@programming.dev !embedded_prog@lemmy.ml
I disagree. Function names should describe, as clearly and as precisely as possible, what they do rather than why they do it in one particular way.
I find comments helpful when the implementation of a function is surprising, i.e. it diverges from patterns one might normally expect for similar tasks. Specialized performance optimizations would be one example I can think of.
ADRs are useful, but I'm not sure they make much sense for implementation details at the level of a function.
All that said, I do agree that functions should be clear in name and content and I think comments should be rare.