Friday, August 14

How to Shoot Yourself in the Foot

The ideosynchracities of various programming languages, exposed through a crude metaphor. This joke has been around for a while, but I'm surprised to hear of some people who work with computers who haven't heard some of them yet..

So - for the benefit of those folk and others, here are a selection of some of my favorites.

C
You shoot yourself in the foot.

C++
You accidently create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance 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."

ASP.NET
Find a gun, it falls apart. Put it back together, it falls apart again. You try using the .GUN Framework, it falls apart. You stab yourself in the foot instead.

Perl
You shoot yourself in the foot, but nobody can understand how you did it. Six months later, neither can you.

JavaScript
You've perfected a robust, rich user experience for shooting yourself in the foot. You then find that bullets are disabled on your gun.

Forth
Foot yourself in the shoot.

APL
You shoot yourself in the foot; then spend all day figuring out how to do it in fewer characters.

PHP
You shoot yourself in the foot using bits of other guns you found on the web.

Brainfuck
+++[>-->+>-<<<]>.----->+.>[>----<].+++<--->[-].<--.
That took so long to get right, you must have shot yourself in the foot at least once by now.

Ruby
Your foot is ready to be shot, but you just can't find anywhere to shoot it.

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.

MUMPS
You shoot 583149 AK-47 teflon-tipped, hollow-point, armour-piercing bullets into even-numbered toes on odd-numbered feet of everyone in the building -- with one line of code. Three weeks later you shoot yourself in the head rather than try to modify that line.

Java
You locate the Gun class, but discover that the Bullet class is abstract, so you extend it and write the missing part of the implementation. Then you implement the ShootAble interface for your foot, and recompile the Foot class. The interface lets the bullet call the doDamage method on the Foot, so the Foot can damage itself in the most effective way. Now you run the program, and call the doShoot method on the instance of the Gun class. First the Gun creates an instance of Bullet, which calls the doFire method on the Gun. The Gun calls the hit(Bullet) method on the Foot, and the instance of Bullet is passed to the Foot. But this causes an IllegalHitByBullet exception to be thrown, and you die.

csh
You can't remember the syntax for anything in this language, so you spend five hours reading manual pages, then your foot falls asleep. You shoot the computer.

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...

SQL
INSERT INTO Foot
SELECT Bullet
FROM Gun.Hand
WHERE Chamber = 'loaded'
AND Trigger = 'pulled'

Genetic Algorithms
You create 10,000 strings describing the best way to shoot yourself in the foot. By the time the program produces the optimal solution, humans have evolved wings.

CSP
You merely fail to shoot everything that isn't your foot.

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.

Modula/2
After realizing that you can't actually accomplish anything in the language, you shoot yourself in the head.

370 JCL
You send your foot down to MIS with a 4000 page document explaining how you want it to be shot. Three years later, your foot comes back deep fried.

Hypertalk
Put the first bullet of the gun into foot left of leg of you. Answer the result.

BASIC
Shoot self in foot with water pistol. On big systems, continue until entire lower body is waterlogged.

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.

~~~~~~~~~

Okay, it seems it works for OS too:

Unix
You shoot yourself in the foot.

DOS
Cannot locate foot. Bad command or sight line.

AMIGA-DOS
It's a nice gun, but nobody's made bullets for it for over a decade.

Windows 3.1
You have a gun selecter, bullet pop-up help, and shooting sound effects - but you're unable to open shoot.dll...

Windows 95
Your gun is not compatible with these bullets and you must install an upgrade before you can continue. Then you will be informed that you don't have enough memory.

Windows Vista
Warning: Shooting yourself in the foot could potentially damage your foot. Are you sure you want to do this?

Windows 7
This gun does not come with bullets. Our marketing campaign will however recommend that you download bullets directly from us, maintaining our monopoly on both guns and bullets.

~~~~~~~~~

Some of these I wrote myself, some have been around longer than I have! Enjoy!

1 comment: