602
No comment (lemmy.nz)
you are viewing a single comment's thread
view the rest of the comments
[-] wols@lemmy.zip 24 points 1 week ago

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.

this post was submitted on 25 Sep 2026
602 points (98.9% liked)

Programming Humor

3503 readers
1 users here now

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

founded 3 years ago
MODERATORS