I found this somewhere in the interwebs in 2004, so any hope of a correct citation is long lost. Minor changes and formatting are mine, as are as the entirety of the Matlab and RPGCode entries. For those of you who had a life in your early teenage years, RPGCode is a C-based language used for scripting within the RPGToolkit, a free collection of utilities for making tile-based RPGs from scratch. Perhaps I'll node it one day. Feel free to suggest better descriptions for any language or even point out the origin, if you know it.
The basic idea is to illustrate the particular faults or quirks of each language in the context of performing a simple task. Note that even successful operation would be harmful to you, but most languages refuse to even cooperate in that, and instead find elaborate ways to be more harmful than you've intended. The few which result in benign outcomes (cf. BASIC) are humorous exceptions which illustrate the apparent impotence of that language: all the others hurt you more than you wanted them to, but these can't hurt you at all even when you want them to.
It helps if you've had some programming experience before reading this, as it makes the whole thing a lot funnier. I haven't used each of these languages personally, but the five I have used are described accurately, and they gave me enough insight into the differences between languages to understand (in most cases) what it actually says about the language's operation for it to behave this way. For example, Matlab differs from C in that programming is easier when everything is stuffed into a vector, since Matlab has so many quick vector operations. It also has a powerful graphing utility (which C entirely lacks), so even though you could shoot yourself in the foot in Matlab, you're likely to end up doing something else instead because it's so much easier that way, even though it wasn't exactly your goal. The humor of the Microsoft C++ w/ Windows SDK should be readily apparent to anyone who's used a Microsoft product, not just programmers.
The proliferation of modern programming languages which seem to have stolen countless features from each other sometimes makes it difficult to remember which language you're using. This guide is offered as a public service to help programmers in such dilemmas.
- C: You shoot yourself in the foot.
- Assembly: You crash the OS and overwrite the root disk. The system
administrator arrives and shoots
you in the foot. After a moment of contemplation, the administrator
shoots himself in the foot and
then hops around the room rabidly shooting at everyone in sight.
- APL: You hear a gunshot, and there's a hole in your foot, but you don't
remember enough linear algebra to understand what the heck happened.
- C++: You accidentally create a dozen instances of yourself and shoot
them all in the foot. Providing
emergency medical care is impossible since you can't tell which are
bitwise copies and which are
just pointing at others and saying, "That's me, over there."
- Ada: If you are dumb enough to actually use this language, the United
States Department of Defense
will kidnap you, stand you up on front of a firing squad, and tell the
soldiers, "Shoot at his
feet."
- MODULA-2: After realizing that you can't actually accomplish anything
in the language, you shoot
yourself in the head.
- Pascal: Same as Modula-2, except the bullets are the wrong type and
won't pass through the barrel.
The gun explodes.
- sh,csh,etc: You can't remember the syntax for anything, so you spend
five hours reading man pages
before giving up. You then shoot the computer and switch to C.
- Smalltalk: You spend so much time playing with the graphics and
windowing system that your boss
shoots you in the foot, takes away your workstation, and makes you
develop in COBOL on a character
terminal.
- FORTRAN: You shoot yourself in each toe, iteratively, until you run out
of toes, then you read in
the next foot and repeat. If you run out of bullets, you continue
anyway because you have no
exception-processing ability.
- ALGOL: You shoot yourself in the foot with a musket. The musket is
aesthetically fascinating, and the
wound baffles the adolescent medic in the emergency room.
- COBOL: USEing a COLT45 HANDGUN, AIM gun at LEG.FOOT, THEN place
ARM.HAND.FINGER on HANDGUN.TRIGGER,
and SQUEEZE. THEN return HANDGUN to HOLSTER. Check whether shoelace
needs to be retied.
- BASIC: Shoot self in foot with water pistol. On big systems, continue
until entire lower body is
waterlogged.
- PL/I: You consume all available system resources, including all the
offline bullets. The Data
Processing & Payroll Department doubles its size, triples its budget,
acquires four new mainframes,
and drops the original one on your foot.
- SNOBOL: You grab your foot with your hand, then rewrite your hand to be
a bullet. The act of
shooting the original foot then changes your hand/bullet into yet
another foot (a left foot).
- LISP: You shoot yourself in the appendage which holds the gun with
which you shoot yourself in the
appendage which holds the gun with which you shoot yourself in the
appendage which holds the gun
with which you shoot yourself in the appendage which holds...
- SCHEME: You shoot yourself in the appendage which holds the gun with
which you shoot yourself in the
appendage which holds the gun with which you shoot yourself in the
appendage which holds the gun
with which you shoot yourself in the appendage which holds... ...but
none of the other appendages
are aware of this happening.
- English: You put your foot in your mouth, then bite it off.
- MICROSOFT C++ w/ WINDOWS SDK: You write about 100 lines of code to
print "Hello, world!" in a
dialogue box, only to have a UAE pop up when you click on OK. This
shuts down the program manager,
leaving you nothing but a screensaver. You then fly to Washington and
shoot Bill Gates in the foot.
- LOGO: You tell a turtle to draw a picture of a foot and a gun, then
shoot the turtle.
- Matlab: You load all your toes into a vector and shoot at their average location while printing graphs of the blood spatter trajectories.
- RPGCode: You can't find the command to pull the trigger, but you know eight different ways to make the bullets glow in the dark and cause 17 points/second of mana depletion. Your foot runs obliviously in a circle around the town well.