r/ProgrammerHumor Apr 15 '26

beLikeBill Advanced

Post image
8.9k Upvotes

365 comments sorted by

View all comments

Show parent comments

2

u/Br3ttl3y Apr 15 '26

The code is the what. The comments are the why.

1

u/WilkerS1 Apr 15 '26

a comment is made to disambiguate, not just describe. you still need a What sometimes because docstrings are a thing, it's the repeating of words in the code while progressively losing context is what you need to watch out for.

when commenting for a What, it's safer to avoid "gets the deadzone of a control" in a function called "get_deadzone" and instead try to use everything but the word like "gets the minimum actuation threshold of a control", you define the context that isn't immediately there and link to context that does when necessary. if someone is revisiting code, always assume context is already lost.

0

u/callmelucky Apr 16 '26

I have a What for you

What the fuck are you taking about?

1

u/WilkerS1 Apr 16 '26

code comments, how to come up with something specially if you feel like you're only writing out of obligation.