this post was submitted on 14 Mar 2025
739 points (98.8% liked)

Programmer Humor

21530 readers
1807 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 1 day ago (1 children)

Yeah, there's a balance. If you comment every row of your code, you aren't naming things clearly. If you never comment, the context is always incomplete.

[–] [email protected] 3 points 1 day ago* (last edited 1 day ago) (2 children)

You don't comment what something does, ir can clearly be seen from the code itself. You comment why you do it.

[–] [email protected] 3 points 21 hours ago (1 children)

"Clearly" is also subjective. What might be perfectly clear to me reading my own code may be really confusing to someone else, and vice versa. Especially if the person reading the code isn't as familiar with the language as the person who wrote it, or if the code is using some syntactic sugar that isn't super common, or plenty of other reasons.

[–] [email protected] 2 points 21 hours ago

True. It's more like there's no need to comment an if statement with "checks if a is larger than b"

[–] [email protected] 3 points 1 day ago

Yes, that would be the context I'm talking about