![]() |
#31 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,492
Karma: 37057604
Join Date: Jan 2008
Device: Pocketbook
|
C
C code C code run Run Darnit RUN! |
![]() |
![]() |
![]() |
#32 |
New York Editor
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#33 |
Cultural Artist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,128
Karma: 12829
Join Date: May 2008
Location: Georgia
Device: Sony 505, Kindle 2
|
|
![]() |
![]() |
![]() |
#34 |
Ebook Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 225
Karma: 2136
Join Date: Jul 2003
Location: Appleton, Wisconsin, USA
Device: Kindle Paperwhite Signature Edition
|
Will I date myself if I admit my favorites are Assembly Language and 370 JCL?
|
![]() |
![]() |
![]() |
#35 |
Cultural Artist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,128
Karma: 12829
Join Date: May 2008
Location: Georgia
Device: Sony 505, Kindle 2
|
|
![]() |
![]() |
![]() |
#36 | |
New York Editor
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
|
Quote:
Of course, there are worse things, like Intercal and Brainf*ck. ![]() ______ Dennis Who to his lasting amusement found both a BF interpreter and an IDE for writing BF code on his PalmOS device... |
|
![]() |
![]() |
![]() |
#37 | ||
Technogeezer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,233
Karma: 1601464
Join Date: Nov 2006
Location: Virginia, USA
Device: Sony PRS-500
|
Great stuff.
Quote:
Quote:
//SHOOTTOE JOB (123FOOTS),'SHOOT OWN FOOT',CLASS=L,MSGCLASS=X
//SYSPRINT DD SYSOUT=* //STEP01 EXEC PGM=LOADGUN //SYSUT1 DD DSN=GUN,DISP=SHR, // SPACE=(CYL,(6,1),RLSE) //INPUT01 DD DSN=BULLET,DISP=(NEW,AIM,FIRE) //STEP02 EXEC PGM=AIMGUN,COND(4,GT,STEP01) //SYSUT1 DD DSN=GUN,DISP=SHR, // SPACE=(CYL,(6,1),RLSE) //SYSUT2 DD DSN=EYEBALL //SYSUT3 DD DSN=FOOT(TOE) //STEP03 EXEC PGM=PULLTRIGGER,COND(4,GT,STEP02) //SYSUT1 DD DSN=GUN,DISP=SHR, // SPACE=(CYL,(6,1),RLSE) //SYSUT2 DD DSN=FINGER //SYSIN DD DUMMY |
||
![]() |
![]() |
![]() |
#38 | |
New York Editor
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
|
Quote:
Early versions of the C language would compile to Assembler, which would then be assembled into actual machine code by the system assembler. It was possible to interrupt the compilation at the Assembler output stage, and then go in and optimize that before assembling it into the actual machine code you would run. That doesn't happen now either: compilers have been syteadily improved, and can generally do a better job of optimization than the programmer. In the old days, programmers would write in Assembler when they needed to squeeze that last possible bit of performance from the machine. Assembler allows the tightest and most efficient code, but it's significantly harder to write and maintain. That is seldom done now, as hardware has gotten fast and cheap enough that it's usually more cost effective to get more hardware than to spend the time and effort required to get the code to run acceptably on what you have. Assembler still sees usage in things like device drivers that talk directly to the hardware, and embedded applications in things like set top boxes and cell phones. 370 JCL is an IBM mainframe curiousity. IBM mainframes are batch processing machines, where jobs are submitted to be run in batches. The MVS operating system has a component called JES (Job Entry Subsystem), and JCL (Job Control Language) that you use to control it. All mainframe batch jobs are run from "procs" -- sets of JCL statements that define the job, what programs will be run as part of it, what data those programs will process and where it resides, and where to send the output. I think I still have an OS 370 JCL manual around somewhere... ______ Dennis |
|
![]() |
![]() |
![]() |
#39 |
books & doughnuts
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 882
Karma: 37857
Join Date: Jan 2007
Location: usa
Device: sony reader, kindle2
|
love the jjokes, the big joke is me programming anything other than a vcr, is flashing 12:00 the new standard?
|
![]() |
![]() |
![]() |
#40 |
Recovering Gadget Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,381
Karma: 676161
Join Date: May 2004
Location: Pittsburgh, PA
Device: iPad
|
Old fashioned character rap...
<>!*''# ^@`$$- !*'$_ %*<>#4 &)../ |{~~SYSTEM HALTED Transliterated: Waka waka bang splat tick tick hash, Caret at back-tick dollar dollar dash, Bang splat tick dollar under-score, Percent splat waka waka number four, Ampersand right-paren dot dot slash, Vertical-bar curly-bracket tilde tilde CRASH. (So... did you know that < and > are called waka, and ! is bang, etc.?!!) |
![]() |
![]() |
![]() |
#41 | |
zeldinha zippy zeldissima
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
Quote:
(and no, i did not know about the waka waka, bang, etc. but i will be sure to use the proper names for those symbols from now on.) |
|
![]() |
![]() |
![]() |
#42 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,492
Karma: 37057604
Join Date: Jan 2008
Device: Pocketbook
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#43 |
Technogeezer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,233
Karma: 1601464
Join Date: Nov 2006
Location: Virginia, USA
Device: Sony PRS-500
|
Without a RLSE parameter the cylinder will not turn and you cannot chamber a round or advance the cylinder -- in short, it would not spin. If you wanted to make it a more fluid program you could perhaps use the "//SYSIN DD *" and provide each parameter in sequence rather than the more generic programs I used such as load, aim and fire.
|
![]() |
![]() |
![]() |
#44 | |
New York Editor
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,384
Karma: 16540415
Join Date: Aug 2007
Device: PalmTX, Pocket eDGe, Alcatel Fierce 4, RCA Viking Pro 10, Nexus 7
|
Quote:
![]() ______ Dennis |
|
![]() |
![]() |
![]() |
#45 |
zeldinha zippy zeldissima
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
|
this whole discussion is a testament to your collective extreme geekiness. i think your geek cards may need to be upgraded to platinum, if they haven't been already.
|
![]() |
![]() |
![]() |
Tags |
unutterable silliness |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Computer programming books | JoshLessard | Amazon Kindle | 6 | 08-08-2010 06:08 PM |
Unutterably Silly Really BAD Christmas Jokes | Slite | Lounge | 97 | 01-04-2010 05:43 PM |
Free programming and computer science e-books | TadW | Deals and Resources (No Self-Promotion or Affiliate Links) | 2 | 01-17-2005 10:39 PM |