this post was submitted on 07 Dec 2023
823 points (96.2% liked)

Programmer Humor

19452 readers
66 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
823
submitted 11 months ago* (last edited 11 months ago) by [email protected] to c/[email protected]
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 137 points 11 months ago (3 children)

Rust:

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

[–] [email protected] 74 points 11 months ago (1 children)

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

[–] [email protected] 16 points 11 months ago

…good enough.

Ill get her back in 3 minutes

[–] [email protected] 39 points 11 months ago (2 children)

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

[–] [email protected] 11 points 11 months ago (1 children)

That just means you designed your castle unsafely.

load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 109 points 11 months ago (6 children)

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

[–] [email protected] 77 points 11 months ago (1 children)

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

[–] [email protected] 25 points 11 months ago (2 children)

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

load more comments (2 replies)
[–] [email protected] 26 points 11 months ago (1 children)

The artist is still waiting for the python cells to render.

load more comments (1 replies)
[–] [email protected] 22 points 11 months ago (1 children)

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

load more comments (1 replies)
[–] [email protected] 18 points 11 months ago (1 children)
[–] [email protected] 14 points 11 months ago

Which is a library written in C, of course.

load more comments (2 replies)
[–] [email protected] 90 points 11 months ago (2 children)

Python:

from Rescues import Princess
Princess.rescue()
[–] [email protected] 25 points 11 months ago (1 children)

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

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 82 points 11 months ago (3 children)

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

[–] [email protected] 52 points 11 months ago (2 children)

NOOOOOOO NOT THE FUCK W*RD!

[–] [email protected] 20 points 11 months ago (1 children)

I can't fucking believe you've done this

[–] [email protected] 11 points 11 months ago (3 children)

Yeah. I thought we all agreed that we don't fucking swear here. What the fuck...Shit. Darn-it. /s

load more comments (3 replies)
[–] [email protected] 12 points 11 months ago

Now I can't let my cats see this comic :(

[–] [email protected] 34 points 11 months ago

Changed the image link, thanks.

load more comments (1 replies)
[–] [email protected] 76 points 11 months ago (1 children)

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

[–] [email protected] 18 points 11 months ago (2 children)

the author did another comic with swift and it's pretty much what you said lol

https://toggl.com/blog/kill-dragon-comic

load more comments (2 replies)
[–] [email protected] 67 points 11 months ago (1 children)

You have Rust. (the knight in this panel looks very cool, wears sunglasses, and probably has a ponytail)

You've been told how easy it is to rescue the princess. Absolutely nothing will get in your way, they say; nobody can possibly get access to your plan, and you can even rescue multiple princesses simultaneously! (in this panel, the knight is imagining rescuing three princesses from three different castles at the same time)

You start working on your plan. It's elegant and beautiful. You write articles on Medium to tell other knights how to rescue their princess. You tell everyone who will listen about your plan. You become a Rust zealot. You never rescue the princess. (In this panel, the knight is nowhere to be seen, and the princess looks bored in her tower. The knight is across the field, at a festival with the banner "RUSTCONF" flying overhead)

[–] [email protected] 16 points 11 months ago (1 children)

yeah but memory safety tho

[–] [email protected] 10 points 11 months ago (2 children)

Yeah not one mention of "I'll never forget you Princess"

load more comments (2 replies)
[–] [email protected] 39 points 11 months ago (2 children)

Omg Lisp. I'm dying. Our object oriented programming class in college involved programming in Scheme. This was... a while ago.

Saving this forever.

[–] [email protected] 14 points 11 months ago

Yup, Scheme was the only programming language taught in our comp-sci department so we could "learn how to learn." Two years and a broken parentheses button later, and I switched to being a theatre major.

Today, my legal career stands as a testament to the pointlessness of a declared major.

load more comments (1 replies)
[–] [email protected] 39 points 11 months ago (4 children)

Always good to see Jon Skeet get some love. I'd love to know in terms of quantity just how many people he's helped over the last decade or so.

[–] [email protected] 21 points 11 months ago

He has used this comic as his profile pic on Twitter and StackOverflow for quite a while.

[–] [email protected] 14 points 11 months ago

Literally every time I've ever posted a question on SO that's related to .NET, Skeet comes to my rescue.

[–] [email protected] 10 points 11 months ago (1 children)

I just wonder how many he would have saved if he didn't write the language in the first place

load more comments (1 replies)
[–] [email protected] 8 points 11 months ago

if we count the number of people who have used products with code helped by him; we're probably around 50% of all humanity by now. at least...

[–] [email protected] 38 points 11 months ago

You have Rust.

Forget rescuing the princess, that's unsafe. Lock her down even more!

[–] [email protected] 33 points 11 months ago (1 children)

You use Assembly.

You describe each and every leg movement and each and every step to the castle and over the castle bridge and inside the castle.

You somehow end up in the castle kitchen.

[–] [email protected] 18 points 11 months ago* (last edited 11 months ago) (2 children)

Or more precisely. You end up in a dark room. You’re not sure it’s in the castle.

load more comments (2 replies)
[–] [email protected] 20 points 11 months ago* (last edited 11 months ago)

You have rust.

You get a horse and arrive at the castle within seconds but the horse is too old and doesn't work with the castle.

You remove the horse, destructure the castle and rescue the princess within seconds, but now you have no horse.

While you're finding a compatible horse and thinking whether you should write your own horse, Bowser recaptures the princess and moves her to another castle.

[–] [email protected] 19 points 11 months ago* (last edited 11 months ago) (1 children)

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!

load more comments (1 replies)
[–] [email protected] 19 points 11 months ago (1 children)

PHP 8 makes it finally possible to rescue the princess, but you accidentally princess the rescue instead.

[–] [email protected] 17 points 11 months ago (1 children)

PHP 8 makes it possible to rescue the princess but your 83 legacy princesses are all still PHP 5.

load more comments (1 replies)
[–] [email protected] 19 points 11 months ago* (last edited 11 months ago)

Rust: You declare the castle type as unsafe and then search for a crate with a rescue_princess function. You discover the princess you rescued is a femboy wolfkin named Pawws. You now have pubic lice and an inexplicable smug sense of superiority.

[–] [email protected] 18 points 11 months ago (1 children)

The Patsy from Monty Python in the PHP section got me

[–] [email protected] 8 points 11 months ago (3 children)

"Message for you sir!"

*argh*

load more comments (3 replies)
[–] [email protected] 17 points 11 months ago (1 children)

Rust:

You crushed the princess under the weight of all the crates you imported

[–] [email protected] 10 points 11 months ago

Nothing against the singularity that is a node_modules directory

[–] [email protected] 14 points 11 months ago (1 children)

C# is about right. LINQ was meant to make things easier, or at least the code easier to read. Instead, you gain this addiction to seeing how much functional logic you can fit into one line of code (or a single multi-line query) while still remaining readable.

load more comments (1 replies)
[–] [email protected] 12 points 11 months ago (2 children)

Ruby: there is a built in method called free_the_princess()

load more comments (2 replies)
[–] [email protected] 10 points 11 months ago (3 children)

Why's this look so poo on my phone?

[–] [email protected] 21 points 11 months ago (8 children)

Might be the client. I use eternity and it looks OK on my phone.

[–] [email protected] 9 points 11 months ago (1 children)

Also good with Boost once I opened the image and clicked "HD".

load more comments (1 replies)
load more comments (7 replies)
load more comments (2 replies)
[–] [email protected] 9 points 11 months ago

You have rust, you decide to rewrite the C plan but the only library that supports it uses unsafe code so you go back and rewrite it. Wait what were you working on?

load more comments
view more: next ›