View Single Post
Old 08-02-2008, 05:17 PM   #32
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
Programming language comparison: how to shoot yourself in the foot

There are many programming languages, and a continuing question is which to use. One way to address this is to describe how a common tesk is performed in different languages. In this case, the task is "shoot yourself on the foot".

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

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.

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.

Pascal: The compiler won't let you shoot yourself in the foot.

FORTH: Foot in yourself shoot.

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

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

Assembly language: You try to shoot yourself in the foot only to discover you must first reinvent the gun, the bullet, and your 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 the gun with which you shoot yourself in the appendage which holds...

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

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.

Concurrent Euclid: You shoot yourself in somebody else's foot.

Java: After importing java.awt.right.foot.* and java.awt.gun.right.hand.*, and writing the classes and methods of those classes needed, you’ve forgotten what the hell you’re doing.

Ada: After correctly packaging your foot, you attempt to concurrently load the gun, pull the trigger, scream and shoot yourself in the foot. When you try, however, you discover that your foot is of the wrong type.

Algol 60: You spend hours trying to figure out how to fire the gun since it doesn't have any provision for input or output.

Algol 68: You mildly deprocedure the gun, the bullet gets firmly dereferenced, and your foot is strongly coerced to void.

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.

Clipper: You grab a bullet, get ready to insert it in the gun so that you can shoot yourself in the foot, and discover that the gun that the bullet fits has not yet been built, but should be arriving in the mail REAL SOON NOW.

CSS: You shoot your right foot with one hand, then switch hands to shoot your left foot but you realize that the gun has turned into a banana.

DBase IV version 1.0: You pull the trigger, but it turns out that the gun was a poorly-designed grenade and the whole building blows up.

DBase: You squeeze the trigger, but the bullet moves so slowly that by the time your foot feels the pain you've forgotten why you shot yourself anyway.

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.

English: You put your foot in your mouth, then bite it off.

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

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.

Motif: You spend days writing a UIL description of your foot, the trajectory, the bullet, and the intricate scrollwork on the ivory handles of the gun. When you finally get around to pulling the trigger, the gun jams.

Objective C: You write a protocol for shooting yourself in the foot so that all people can get shot in their feet.

Paradox: Not only can you shoot yourself in the foot, your users can too.

PL/I: You consume all available system resources, including all the offline bullets. The Data Processing & Payroll Department doubles its size, triples its budget, acquires four new mainframes, and drops the original one on your foot.

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.

Revelation: You'll be able to shoot yourself in the foot just as soon as you figure out what all these bullets are for.

Ruby: Your foot is ready to be shot in roughly five minutes, but you just can’t find anywhere to shoot it.

Ruby on Rails: You start to think about shooting yourself in the foot only to discover that someone has already shot your foot for you.

Scheme: 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 the gun with which you shoot yourself in the appendage which holds...
...but none of the other appendages are aware of this happening.

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.

Smalltalk: self foot shoot

Snobol: If you succeed, shoot yourself in the left foot. If you fail, shoot yourself in the right foot.

SQL: SELECT @ammo:=bullet FROM gun WHERE trigger = ‘PULLED’; INSERT INTO leg (foot) VALUES (@ammo);

Unix:
% ls
foot.c foot.h foot.o toe.c toe.o
% rm * .o
rm: .o: No such file or directory
% ls

Visual Basic: You can't shoot yourself in the foot, but you'll have so much fun trying that you won't care.

XML: After describing the pistol, the bullets, and your foot in minute detail, you find out that you can’t actually get to shoot your foot. So you begin describing your disappointment instead.
______
Dennis

Last edited by DMcCunney; 08-02-2008 at 05:38 PM.
DMcCunney is offline   Reply With Quote