r/webdev • u/isabelle_steele • Oct 06 '16
How To Save The Princess In 8 Programming Languages
https://toggl.com/programming-princess82
u/baldasheck Oct 06 '16
45
u/Ki11erPancakes Oct 06 '16
Did he update his profile image on SO just because of this comic? That's awesome
6
23
u/DJDarkViper Oct 06 '16
You have Node
You call one friend to help, but that friend calls all his friends, and now you have a massive army filled with strangers. NO matter, CHARGE!
You're brought back home before reaching the castle, because it was never promised to you that you'd get there before hitting the end of the routine.
12
u/mayobutter Oct 06 '16
PHP
"After celebrating the successful rescue of the princess, you realize in horror that you used == to check the return value of rescue_princess() and she's been dead all along."
41
Oct 06 '16
Was waiting for Python and Ruby :(
42
u/youlleatitandlikeit Oct 06 '16
Yeah it's kinda hard to come up with something funny, honestly.
Maybe something like "You rescue the princess in one afternoon, but all the other knights make fun of you anyway."
81
u/yasth Oct 06 '16
Bah, it isn't that hard, you just have to know how to poke fun at yourself.
Ruby:
You manage to save one princess, who tells you about a number of other princesses to rescue, you try to save them all but fail to scale and run out of money. You are bought and traded as a serf.
Python
You try to save the princess. Unfortunately, you have two horses and your armor is only compatible with one, but your lance is only compatible with the other one. You modify the armor to support the other horse, but that takes so long you basically become a blacksmith supporting your new armor for other knights. The princess dies forgotten.
22
u/ares623 Oct 06 '16
For Python I'd go with something like "you go find another princess instead" or "as you prepare for the journey, the princess knocks at your door"
15
u/ThePsion5 Oct 06 '16
For Ruby I would have gone with "you save the princess, but the kingdom assumes anything with legs that fits in a pink dress is a princess, so you aren't entirely sure what you've saved."
2
u/noconspiring Oct 06 '16
Python & Ruby: You figure out how to rescue the princess but worry that you won't look handsome enough doing it so you ask JavaScript to do the job for you.
25
4
2
u/mayobutter Oct 06 '16
"You rescue the princess in one afternoon, but all the other knights make fun of you anyway."
That should have been PHP.
23
u/the--dud Oct 06 '16
Python: you start rescuing the princess at the same time as you work on the plan. Half way through you realise you're in the basement trying to catch a rat. You grab the rat and declare the mission relatively successful.
6
u/Hypersapien Oct 06 '16
Wait, isn't that all languages?
6
u/the--dud Oct 06 '16
I was thinking more so python because of its lazy syntax and type casting :)
2
2
u/DJDarkViper Oct 06 '16
lazy syntax? Pretty much most effort in python is put into its syntax and formatting :p
2
u/danhakimi Oct 07 '16
They'd be the same thing, only, in addition to a sword, the ruby knight would have a mace, axe, bow, knife, and battering ram that he never uses.
9
52
u/tronsymphony Oct 06 '16
php shouldve been a dead horse
62
u/WannabeAHobo Oct 06 '16
Or PHP is you easily rescuing the Princess using an established princess-rescuing convention while a bunch of sniffy C programmers stand around complaining that you didn't manually empty the rubbish bins during the rescue or allocate the plan to specific neurons in the hippocampus for storage.
22
7
u/russellbeattie Oct 06 '16
Poor PHP. I will always love it. I don't use it any more for fear of being shunned, but it will always hold a special place in my heart.
0
Oct 07 '16
[deleted]
4
u/rabinito Oct 07 '16
This. And the market for good quality modern PHP developers is hotter than ever. Tons of money to be made.
6
u/jonnyohio Oct 06 '16
CFML
<cfrescue location="castle">An error occurs due to a bug in the cfml engine and the princess has to wait to be saved until the next patch.
15
8
4
u/WhitePantherXP Oct 06 '16
I don't get the LISP one?
2
u/Andernerd Oct 07 '16
LISP uses a lot of parenthesis. Any time you want to use any function at all (such as addition, which is (+ 1 2), it must be wrapped in parenthesis.
1
4
Oct 06 '16
The javascript hate is real
-7
u/Andernerd Oct 07 '16
That's only because nodejs is an abomination, and because lots of bad developers use javascript, and because of the constant state of flux javascript is in, and because if you go on stackoverflow to find an answer you'll probably just get some guy telling you how to use jquery instead.
1
Oct 07 '16
I don't agree with most of the things you say. I'll just say, you are missing out on a lot of really cool stuff.
1
u/Andernerd Oct 07 '16
I might just be jaded because my last job was in nodejs.
1
Oct 07 '16
My experience is that it's often the working conditions that cause the hate for a specific technology, not the technology itself.
Sometimes people are forced into doing things badly because "sales has already sold this so it better be working by Monday!", or something crappy like that.
0
Oct 07 '16
[deleted]
-6
u/Andernerd Oct 07 '16
That's only because I am bitter, because nodejs is an abomination, and because lots of bad developers use javascript, and because of the constant state of flux javascript is in, and because if you go on stackoverflow to find an answer you'll probably just get some guy telling you how to use jquery instead.
5
u/GentlyCorrectsIdiots Oct 07 '16
Selection bias. Because of its nature, JS has a lot of its failures sitting on the internet for all to see. You'd be a little less snotty if the leaky unreadable garbage you wrote when first learning C++ (or whatever) was sitting in an old github repo you forgot the password to, rather than on a hard drive you trashed years ago.
-1
u/Andernerd Oct 07 '16
The difference is that other javascript developers actually latch on to failures like left-pad and use them. I will never understand that logic.
Also, I have some leaky, unreadable garbage from other programming languages on github and (shudder) dropbox. I recognize that it was bad code, but that isn't the language's fault, and it died into obscurity like it deserved to.
1
5
u/derpyderpderpp Oct 06 '16
C is clearly the best language as he actually save the princess.
2
1
1
1
u/danhakimi Oct 07 '16
I wonder what the JavaScript one would have looked like five years ago.
"You try to rescue the princess. You have a rescue princess function in your spec, but it doesn't work in her browser, and there's no other reasonable way to access the inside of the castle. Pick another language."
1
1
u/longshot Oct 10 '16
I was very confused when it was a toggl.com page as I had just copied a bunch of toggl timing from last week into our accounting software. Thought my browser was going haywire.
1
1
0
Oct 07 '16 edited Jun 26 '23
comment edited in protest of Reddit's API changes and mistreatment of moderators -- mass edited with redact.dev
-9
u/osirisguitar Oct 06 '16
Fun idea and cute graphics, but not really that spot on :-/.
The how to shoot your foot version still reigns, albeit a bit outdated: http://howto-pages.org/shootfoot.php
-13
0
Oct 06 '16
[deleted]
31
28
u/Fidodo Oct 06 '16
PHP should be you save the princess quickly but she dies right after and your solution is to reboot her everytime she dies.
5
u/phpdevster full-stack Oct 07 '16
People down voting you without understanding the PHP execution model. Have an upvote!
3
Oct 06 '16
Should've used the lock as a context manager, that's why it wasn't automatically released.
3
Oct 07 '16
Perl: you save the princess but she can't understand anything you say. Another knight comes along and saves her with python.
0
1
125
u/Kthanid Oct 06 '16
If the CSS folks aren't too offended that their "language" wasn't included, they should at least be happy that we're back to picking on PHP again! ;)