Monday, December 21, 2015

Shooting Yourself in the Foot

For my programmer friends there is a very funny webpage about shooting yourself in the foot in various programming languages. The full set can be found here, but here are a few that are particularly amusing plus a couple of entries that I have added:
  • Assembly
    • You try to shoot yourself in the foot only to discover that you must first invent the gun, the bullet, the trigger, and your foot.
    • 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 system administrator shoots himself in the foot and then hops around the room rapidly shooting at everyone in sight.
    • By the time you've written the gun, you are dead, and don't have to worry about shooting your feet. Alternatively, you shoot and miss, but don't notice.
    • Using only 7 bytes of code, you blow off your entire leg in only 2 CPU clock ticks.
  • C
    • You shoot yourself in the foot.
    • You shoot yourself in the foot and then nobody else can figure out what you did.
  • C++
    • You accidentally 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."
  • English
    • You put your foot in your mouth, then bite it off.
  • Haskell
    • On a warm Saturday afternoon, sitting by the pool with a margarita, you casually sit up from your chaise lounge chair, reach over and pick up a gun, aim at your foot, and lazily pull the trigger.
    • You shoot yourself in the foot very elegantly, and wonder why the whole world isn't shooting itself this way.
    • 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. You then hear that it can be done more elegantly with Dyadic Functile Hyper-Arrows, but the very act of reading some of the included sample code causes one of your metatarsals to explode.
    • (Okay, I know we don't use Haskell around here, but I heard someone talk about it once and this is quite funny. Start your own blog and you can leave it out.)
  • HTML
    • You cut a bullethole in your foot with nothing more than a small penknife, but you realize that to make it look convincing, you need to be using Dreamweaver.
  • Java
    • You write a program to shoot yourself in the foot and put it on the Internet. People all over the world shoot themselves in the foot, and everyone leaves your website hobbling and cursing.
    • You amputate your foot at the ankle with a fourteen-pound hacksaw, but you can do it on any platform.
  • JavaScript
    • You find that Microsoft and Sun have released incompatible class libraries both implementing Gun objects. You then find that although there are plenty of Foot objects implemented in the past in many other languages, you cannot get access to one. But, seeing as JavaScript is so cool, you don't care and go around shooting anything else you can find.
  • Linux
    • You shoot yourself in the foot with a Gnu.
  • Mac OS
    • System 7
      • Double-click the gun icon and a window appears, giving a selection for guns, target areas, and balloon help with medical remedies. Click the "shoot" button and a small bomb appears with a note "Bad F-line instruction."
    • System 7.1
      • Double-click the gun icon and a window appears, giving a selection for guns, target areas, and balloon help with medical remedies. Click the "shoot" button and a small bomb appears with a note "Error of type 1 has occurred."
    • 9
      • Double-click the gun icon and a window appears, giving a selection for guns, target areas, and balloon help with medical remedies. Click the "shoot" button and a window appears with the message "You need to install the latest version of CarbonLib. Should I get it for you?" You click "Yes" and your computer hangs.
    • X
      • You try to shoot yourself in the foot from the GUI but the gun has inexplicably turned into a bag of Skittles.
      • You open up the Terminal, type sudo shoot -p ~/Library/BodyParts/Preferences/foot.plist, and your kernel panics.
  • Perl
    • You separate the bullet from the gun with a hyper-optimized regexp, and then you transport it to your foot using several typeglobs. However, the program fails to run and you can't correct it since you don't understand what the hell it is you've written.
    • You stab yourself in the foot repeatedly with an incredibly large and very heavy Swiss Army knife.
    • You shoot yourself in the foot and then decide it was so much fun that you invent another six completely different ways to do it.
    • There are so many ways to shoot yourself in the foot that you post a query to comp.lang.perl.misc to determine the optimal approach. After sifting through 500 replies (which you accomplish with a short Perl script), not to mention the cross-posts to the perl5-porters mailing list for which you upgraded your first sifter into a package, which of course you uploaded to CPAN for others who might have a similar problem (which, of course, is the problem of sorting out e-mail and news, not the problem of shooting yourself in the foot), you set to the task of simply and elegantly shooting yourself in the foot, until you discover that, while it works fine in most cases, NT, VMS, and various flavors of Linux, AIX, and Irix all let you shoot you in the foot sooner than your Perl script could.
  • PHP
    • Three thousand people line up on your apartment's welcome mat and demand to be shot in their feet. One by one, you oblige them, but halfway through, the http connection times out and the crowd lynches you.
  • Python
    • You shoot yourself in the foot and then brag for hours about how much more elegantly you did it than if you had been using C or (God forbid) Perl.
    • You create a gun module, a gun class, a foot module, and a foot class. After realizing you can't point the gun at the foot, you pass a reference to the gun to a foot object. After the foot is blown up, the gun object remains alive for eternity, ready to shoot all future feet that may happen to appear.
  • Ruby
    • You shoot yourself in the foot and then have to justify it to all your friends who are still naively using Perl.
  • 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.
  • UNIX
    • % ls
      foot.c foot.h foot.o toe.c toe.o
      % rm * .o
      rm: .o: No such file or directory
      % ls
      %
  • Windows
    • 3.1
      • Double-click the gun icon and wait. Eventually a window opens giving a selection for guns and target areas. Click the "shoot" button and a small box appears with the note "Unable to open shoot.dll, check that path is correct."
    • 95
      • Your gun is not compatible with this OS and you must buy an upgrade and install it before you may continue. Then you are informed that you don't have enough memory.
    • ME
      • There will be too many sudden reboots to allow the bullet to get through, so your foot hangs instead.
    • XP
      • Some teenage hacker shoots you in the foot with ActiveX. You develop gangrene and die.
    • Vista
      • You never get your gun to work because the DRM system doesn't allow your far East knock-off bullets to be loaded.
    • 7
      • After some searching you find you need new drivers for your gun. You finally find some drivers and after much trial and error you find the correct gun compatibility mode and shoot yourself in the foot.
      • Shooting is very, very slow. A body upgrade is recommended for acceptable performance.
    • 8
      • Try as you might, you can't find the gun interface because you have a PC and a mouse rather than a touchscreen. After hours of frustration, you revert to Windows 7.
      • Microsoft shoots itself in the foot.
  • XML
    • You vaporize your entire lower half with a bazooka.
    • You can't actually shoot yourself in the foot; all you can do is describe the gun in painful detail.

No comments:

Post a Comment