this post was submitted on 03 Oct 2023
500 points (96.0% liked)

Programmer Humor

19463 readers
30 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 1 year ago
MODERATORS
 
top 17 comments
sorted by: hot top controversial new old
[–] evatronic@lemm.ee 54 points 1 year ago

This is terrible! What half-witted shit-for-brains monkey crapped this craptacular crapfest out?! I swear to Kaballah Monster, as soon as I figure out...

git blame

...oh.

[–] JoMiran@lemmy.ml 34 points 1 year ago

I've been at this for almost thirty years. At this point, I've forgotten more than I have ever learned.

[–] OsrsNeedsF2P@lemmy.ml 17 points 1 year ago (1 children)

Is it my turn to repost this next week

[–] the_artic_one@programming.dev 25 points 1 year ago* (last edited 1 year ago) (1 children)

I should write some documentation so I don't have to remember which memes have already been posted here.

You'll never read it

[–] krey@sh.itjust.works 16 points 1 year ago (2 children)

The trick is to name everything in a way so you don't have to remember stuff. Like instead of class "Cronjob" method "process", name it "ImageCacheEraser" and "purgeByContentID". Same goes for variables. No need for short names. Nowadays, you can even write with short names at first, so typing is faster, then just use your IDE to rename them to full size afterwards.

[–] Speculater@lemmy.world 7 points 1 year ago (2 children)

Just not too short or you'll end up renaming a random variable you didn't mean to... I've heard.

[–] krey@sh.itjust.works 3 points 1 year ago

Some IDEs (like Netbeans, Intellij, PhpStorm) can rename only in the scope of the selected item. So if you used variable "a" in 2 methods, it would only rename in the selected method and it understands the variable is different from "ab" and won't replace the "a" part of that.

[–] hemko@lemmy.dbzer0.com 1 points 1 year ago

for i in...

Agreed except for the variables. You can pry the iterators i, j, k, the pointers p and q, and the temporary buffer buf, from my cold, dead hands.

Short variable names increase code clarity, particularly when the functions employing them are concise and named appropriately. There’s not much worse than using something like sourcedata[databufferiterator] instead of src[i]. It reminds me of authors who think that big words make them sound more intelligent. Needing or advocating auto complete in IDEs is a symptom of this kind of code smell, IMO.

Code should be clear and concise; it’s also why I fight for 8 character indentation; if your code is creeping across the screen it’s a damn good indication that the function might be too complex and should be broken up.

[–] bleistift2@feddit.de 10 points 1 year ago (1 children)

Clean code, extensive documentation, help files and readmes aren’t supposed to prevent you from forgetting how it works. I’m not sure what you’re trying to tell me with the second half of this meme.

[–] krashmo@lemmy.world 9 points 1 year ago

That you're taking things too seriously. It's a meme not a dissertation.

[–] spez@sh.itjust.works 4 points 1 year ago (1 children)

I have a repo with another repo inside it which was the one deployed. I forgot how all of it worked and wasted like 4 hours combined. Definetly gonna write docs from now on.

[–] noobdoomguy8658@feddit.de 12 points 1 year ago (1 children)

Definetly gonna write docs from now on.

Sure thing.

[–] sbv@sh.itjust.works 6 points 1 year ago

They're serious this time

[–] M0ty@lemmy.world 3 points 1 year ago

That's the whole point of documentation, to know how it works AFTER you forget it

[–] sj_zero@lotide.fbxl.net 2 points 1 year ago

And after the 1000 page manual some fuck goes "oh, Bob never documents anything!"