Programming Languages & Feet

Home

This is a collection of jokes about shooting yourself in the foot in different programming languages. These are from various sources, mostly collected from CM20318 lectures held by Russell Bradford at the University of Bath.


C
You shoot yourself in the 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...
Prolog
You tell your program you want to be shot in the foot. The program figures out how to do it, but the syntax doesn't allow it to explain.
Python
You try to shoot yourself in the foot but you just keep hitting the whitespace between your toes.
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.
COBOL
USEing a COLT 45 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.
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-handling facility.
APL
You hear a gunshot and there's a hole in your foot, but you don't remember enough linear algebra to understand what happened.
SNOBOL
If you succeed, you shoot your right foot. If you fail, you shoot your left foot.
Assembly
You try to shoot yourself in the foot, only to discover you must first reinvent the gun, the bullet, and your foot. After that's done, you pull the trigger, the gun beeps several times, then crashes.
BASIC
Shoot yourself in the foot with a water pistol. On big systems, keep shooting yourself in the foot until the lower body is waterlogged.
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.
ALGOL 68
You mildly deprocedure the gun, the bullet gets firmly dereferenced, and your foot is strongly coerced to void.
Pascal
The compiler won't let you shoot yourself in the foot.
Oberon
The gun keeps jamming and the bullets are probably blanks, so you kick the computer and break your foot.
Ada
If you are dumb enough to actually use this language, the United States Department of Defense will kidnap you, stand you up in front of a firing squad, and tell the soldiers, “Shoot at the feet.”
Ada (2)
After correctly packing your foot, you attempt to concurrently load the gun, pull the trigger, scream, and confidently aim at your foot knowing it is safe. However the cordite in the round does an Unchecked Conversion, fires and shoots you in the foot anyway.
ML
You program a structure for your foot, the gun, and the bullet, complete with associated signatures and function definitions. After two hours of laborious typing, forgetting of semicolons, and searching old Comp Sci textbooks for the definition of such phrases as “polymorphic dynamic objective typing system”, as well as an additional hour for brushing up on the lambda calculus, you run the program and the interpreter tells you that the pattern-match between your foot and the bullet is nonexhaustive. You feel a slight tingling pain, but no bullethole appears in your foot because your program did not allow for side-effecting statements.
Scheme
Scheme does not provide a gun as it can be constructed from more fundamental concepts. Nor feet.
Scheme (2)
Haskell
You spend several hours creating a new copy of the universe which is identical to the existing one except your foot has a hole in it.
Haskell (2)
You appear to have successfully shot yourself in the foot, but you feel no pain. Until you look at your foot.
Erlang
Whenever you shoot your foot off, you just grow more feet.
Scala
You can't find anyone who knows how to shoot you in the foot.
LaTeX
\gun[leftfoot]{shoot}
DOS batch
You aim the gun at your foot and pull the trigger, but only a weak gust of warm air hits your foot.
sh, csh, bash
You can't remember the syntax for anything so you spend five hours reading man pages, then your foot falls asleep. You then shoot the computer and switch to Perl.
Perl
You shoot yourself in the foot, but nobody can understand how you did it. Six months later, neither can you.
Ruby
Your foot is ready to be shot in roughly five minutes, but you just can't find anywhere to shoot it.
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.
JCL
You send your foot down to MIS with a 400-page document explaining how you want it to be shot. Three years later, your foot comes back deep-fried.
Visual Basic
You do a Google search on how to shoot yourself in the foot. You find seventeen completely different ways to do it, none of which are properly structured. You paste the first example into the IDE and compile. It brushes your teeth.
Visual Basic (2)
You’ll really only appear to have shot yourself in the foot, but you’ll have so much fun doing it that you won’t care.
Excel
You don't need to shoot yourself in the foot because a macro virus has already done so.
HTML
You cut a bullet hole in your foot with nothing more than a small penknife, but you realise that to make it look convincing, you need to be using Dreamweaver.
XML
You can't actually shoot yourself in the foot; all you can do is describe the gun in painful detail.
CSS
Everyone can now shoot themselves in the foot, but all their feet come out looking identical and attached to their ears.
C++
You accidentally create a dozen clones of yourself and shoot them all in the foot. 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.”
C++ (2)
“C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg” (Bjarne Stroustrup)
Objective C
You write a protocol for shooting yourself in the foot so that all people can get shot in their feet.
Eiffel
You take out a contract on your foot. The precondition is that there’s a bullet in the gun; the postcondition is that there’s a hole in your foot.
Swift
You try to shoot yourself in the foot with the ultra-modern Swift gun, but you discover the gun has no trigger. Instead, it’s designed to shoot automatically only when pointed safely at its intended target, with any type of bullet. Occasionally it explodes in your hand and takes off your arm.
Mathematica
You try to shoot yourself in the foot and then have to figure out why it didn’t work.
Mathematica (2)
Your code to shoot yourself in the foot actually shoots someone else in the foot, but you think it works because you still feel pain.
SQL
You cut your foot off, send it out to a service bureau and when it returns, it has a hole in it but will no longer fit the attachment at the end of your leg.
Occam
You shoot both your feet with several guns at once.
Go
To shoot yourself in the foot you must first import the unsafe package.
Rust
you try to shoot yourself in the foot, but you can’t as the gun has immutably borrowed your foot.
BCPL
You shoot yourself somewhere in the leg - you can't get any finer resolution than that.
Forth
Foot yourself in the shoot.
C#
You forget precisely how to use the .NET interface and shoot yourself in the foot. You sue Microsoft for damages.
C# (2)
You copy how Java shot itself in the foot. Then you explain to everybody who will listen how you did it better.
C# (3)
You can create and shoot a gun in C#, but you can’t shoot your foot in managed code.
Lua
You come up with a decent way to shoot yourself in the foot, but you’re unsure if it’s the optimal way to go about it. You ask the mailing list. Someone points out that Lua has a “shoot foot” function built in, but it’s only exposed via the C API. The discussion devolves into a long debate about whether various functions should be exposed, how objects and OOP should be implemented, and whether nil should be a valid table index.
Lua (2)
You shoot yourself in the foot while watching enviously how Scheme shoots you in the foot.
Simula
?
Smalltalk
You send the message shoot to gun, with selectors bullet and myFoot. A window pops up saying Gunpowder doesNotUnderstand: spark. After several fruitless hours spent browsing the methods for Trigger, FiringPin and IdealGas, you take the easy way out and create ShotFoot, a subclass of Foot with an additional instance variable bulletHole.
Dylan
Tries to shoot you in the foot like Scheme while enviously watching Java eat its lunch.
Lambda Calculus
You try to shoot yourself in the foot, but the gun is curried and one of your rewriting rules breaks capture-avoidance so all you have is a barrel in your calf.
Functional Machine Calculus
You push a jump to a bullet into the gun location, and pop it into the foot term, but your foot evaluates the bullet and eats your entire program before you see the wound.