Shooting Yourself in the Foot

A comparison of various programming languages


In C, you just assign the gun a pointer to your foot, and pull the trigger.

In C++, you can still do it the C way, but it's much easier to just supply your foot as the parameter of the gun's shoot() method.

In Java, you have to do it the C++ way, though the makers claim that you'll be able to shoot yourself with any kind of gun anywhere you want. Unfortunately, it shoots real slowly and misses sometimes, especially when shooting at windows.

In Objective-C, you pick at the time you pull the trigger what type of gun to use and which foot to shoot.

Pascal won't let you shoot yourself in the foot, because it's not proper technique.

Visual Basic won't let you do anything BUT shoot yourself in the foot.

Fortran was made before guns, so you have to use a bow and arrow to do the job.

In Cobol, you have to throw rocks.

In LISP you need to put the gun, the bullet, and your foot in a list, then invoke the shoot function on it.

In Haskell, all you have to do is calculate the value of the shoot function on foot. (You did define shoot, didn't you?)

And, finally, in assembler, the whole process takes a lot longer to plan, because you need to build your own gun, starting with smelting the iron from the ore. On the plus side, it shoots five percent faster than the other guns, and you now know everything there is to know about guns and feet. However, if you want to use a different caliber gun, you'll have to start over from scratch...



662 people have viewed this page since 2 September 2002.

© Andrés Santiago Pérez-Bergquist, All rights reserved. The reproduction of this work, by any means electronic, physical, or otherwise, in whole or in part, except for the purposes of review or criticism, without the express written consent of the author, is strictly prohibited. All references to copyrighted and/or trademarked names and ideas held by other individuals and/or corporations should not be considered a challenge to said copyrights and trademarks.

If you wish to contact the author, you may do so at