this post was submitted on 14 Mar 2025
448 points (99.6% liked)

Programmer Humor

21487 readers
1421 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
[–] lvxferre@mander.xyz 21 points 15 hours ago (4 children)

Aren't you supposed to spam comments and use meaningful variable and function names? That's what I do with my bash scripts.

Oh wait I ain't a programma'. You call this shit R9GFJKL34LTYLKFÇDS and hope for the best, right?

[–] exu@feditown.com 4 points 9 hours ago

I'm also not a programmer, you'll find my longest comments to explain why I've done some terrible mangling, what this does and how.

[–] Ephera@lemmy.ml 23 points 14 hours ago (1 children)

Spamming comments is rather controversial, especially in high-level languages. Problem is, they only show up in one place, so they're just not very useful, but also have a high chance of becoming inaccurate over time. In particular when you spam them to explain relatively trivial stuff, people will stop reading them, meaning they won't update them.

The 'what' can be documented with meaningful variable/function names, log/error/assert messages and perhaps most importantly unit/integration tests (which should be understood like a specification that checks automatically that it's applied correctly).

Comments are indispensible for explaining the 'why', though, whenever that is not obvious.

[–] rockerface@lemm.ee 6 points 12 hours 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.

[–] vaionko@sopuli.xyz 2 points 6 hours ago* (last edited 6 hours ago) (1 children)

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

[–] rockerface@lemm.ee 2 points 6 hours ago

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

[–] subignition@fedia.io 8 points 13 hours ago

Bonus points for the cedilla

[–] some_guy@lemmy.sdf.org 2 points 14 hours ago

Hello fellow basher.