Shooting yourself in the foot in various programming environments

This is inspired by, but not directly ripped off from, the original classic computer science joke of shooting yourself in the foot in various programming languages.

Feel free to send me comments, suggestions, or criticism (see my profile for contact methods, or use Webmention).


You load the gun and take aim at your foot, but when you pull the trigger, you discover that one of the grains of gunpowder is a NULL pointer.

Segmentation fault (core dumped)


You shoot yourself in the foot, but forget to delete the bullet and leak memory.


The compiler won't let you take the safety off.


You build your own gun and make your own bullets. When you pull the trigger, the gun fires forwards and backwards, jams, and falls apart.

Segmentation fault (core dumped)

Machine code

You hand-forge all the parts for a gun and bullet casings, mix your own gunpowder, and assemble it. When you pull the trigger, the world freezes.


The standard library provides a gun and bullets, but your foot needs to implement interface Shootable.


You use a BulletFactory to produce ammunition for one of several Guns, wrap the whole thing in a ShootingManager, and fire at your foot, but the JVM hasn’t warmed up yet. Two minutes later, your foot throws a PainException.


You have a System.Armaments.Firearms.Gun, but can’t find any bullets anywhere. The documentation says they’re in the Firearms namespace with the gun, but doesn’t describe them.


You shoot yourself in the foot with ease, but it takes long enough for you to get lunch and still come back in time to put your foot in front of the bullet.


You dampen your foot and wait for it to rot.


There are eight frameworks for foot-shooting. Of these, three are unmaintained, two are brand-new and full of bugs, one lacks bullets, and the other two require jQuery.


You take aim and pull the trigger, but the gun crashes because the bullets are of the wrong brand. Upon replacing the bullets and gun and trying again, a new foot, now with hole, appears from the gun. You do not know how to replace your existing foot with the shot one.


You fire and miss because your foot is where your knee should be.


You write a 15-page document describing how to shoot yourself in the foot.


You write a beautiful 5-page document describing how to shoot yourself in the foot. As a bonus, it does it for you when you compile it.


You miss, but you can roll it back and try again as many times as you like.


You use SQL to shoot yourself in the foot and send back an HTML file describing the results. Someone does some SQL injection and drops your bullets.


You load a Unicode gun with ANSI bullets and when you pull the trigger your foot is transformed into Asian gibberish.


You don’t have permission to access the foot or the gun.


You ask to be shot in the foot and are presented with 6.4 million choices for guns and bullets. By the time you finally make your decision, the request has timed out.