this post was submitted on 07 Dec 2023
26 points (100.0% liked)

Programmer Humor

25567 readers
287 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
 
top 18 comments
sorted by: hot top controversial new old
[–] Gobbel2000@feddit.de 4 points 2 years ago (2 children)

Rust:

Cannot move princess out of castle which is behind a shared reference

[–] magic_lobster_party@kbin.social 2 points 2 years ago

You can’t rescue the princess, but you can borrow her.

[–] Octopus1348@lemy.lol 0 points 2 years ago (1 children)

It will also complain that trying to break into the castle is unsafe, so you have to tell it that you know.

[–] Rodeo@lemmy.ca 1 points 2 years ago

That just means you designed your castle unsafely.

[–] stebo02@sopuli.xyz 2 points 2 years ago (2 children)

no python? how are normie programmers like me supposed to relate to this?

[–] troyunrau@lemmy.ca 4 points 2 years ago (1 children)

You have python. You import antigravity. The princess flies off into space. You monkey patch the princess so she has wings.

[–] stebo02@sopuli.xyz 1 points 2 years ago

And this is how I learned about the antigravity module. Pretty cool!

[–] CodeMonkey@programming.dev 1 points 2 years ago

Python: You send someone else to rescue the princess on your behalf. That someone else is the C knight.

[–] flumph@programming.dev 1 points 2 years ago (1 children)

I'm going to have to print out the Go version for all future "it's idiomatic" and "but the community!" debates at work

[–] SnipingNinja@slrpnk.net 1 points 2 years ago (1 children)

I'm curious about this but I'm barely a programmer now, so if anyone is up to explain

[–] flumph@programming.dev 1 points 2 years ago

The go community is strongly opinionated in unique ways. For example, using libraries is generally frowned upon. You either use something included in the language itself (standard library) or copy/paste the code you wrote in another project. There's also advocacy for shorter variable names which generally seems counter to the normal "write descriptive variable name" mantra.

All in all, I hope the ideas / opinions came from a good place and then some people took them as black & white rules. But they also come off as one or two people's pet peeves who got to build a language around them.

[–] scratchresistor@thelemmy.club 1 points 2 years ago (1 children)

Python:

from Rescues import Princess
Princess.rescue()
[–] bob_lemon@feddit.de 0 points 2 years ago (1 children)

map(lambda princess: princess.rescue(), [castle.get_princess() for castle in castles])

[–] scratchresistor@thelemmy.club 1 points 2 years ago

Don't forget to keep your return values...

rescued_princesses = [{"princess": princess, "rescued": princess.rescue()} for princess in [castle.get_princess() for castle in castles]]

[–] smeg@feddit.uk 1 points 2 years ago (1 children)

Here is the original comic, it's got the word fuck in it! Direct link to higher-quality image.

[–] PixxlMan@lemmy.world 1 points 2 years ago

NOOOOOOO NOT THE FUCK W*RD!

[–] killeronthecorner@lemmy.world 1 points 2 years ago

Swift: Apple releases a new version of the castle and deprecates the princess before you finish your implementation

[–] kSPvhmTOlwvMd7Y7E@lemmy.world 1 points 2 years ago* (last edited 2 years ago)

So let me summarise this:

Only C and Lisp actually completed the initial task of getting the princess free, and Author clearly favors C over the drooling and homeless lisp hacker. Also, turns out, C greatest weakness helped to save not only the princess but everything she ever possessed! How convenient!