How to shoot yourself in the foot in any programming language

Java
Build the Gun class, build the Foot class, create a relation between Gun and Foot classes, compile Gun, load Gun and shoot yourself in Foot. Only to realize that there is another Gun packaged in a jar shooting at same Foot giving you Gun loader errors.

C
Create required functions and point Gun to shoot yourself in Foot. When you shoot you find that the gun was pointing to someone else’s foot.

JavaScript
Create Gun and Foot functions, create a nice interface to shoot yourself in foot. But you get runtime error saying error in line 20007. After hectic bug fixing, you correct line 150 only to find that the bullets are disabled in MS IE Gun, so that you cannot shoot.

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.

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

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.

Swing
You create Gun and Foot instances, fire action events with Gun, only to realise that you could have done better and saved more time with a simple FLASH Gun.

Struts
You attempt to create Gun and Foot instances, create the GunHandler classs, create the GunAction class, create the Delegate, SessionFacade, DAO, Value object etc. You are too tired now to shoot yourself in the foot. The boss shoots you in the foot instead.

JSF
You create Gun and Foot instances, compare them with the one you made using Struts, feel better about it, only to find there’s a JSF bug which stops your Gun from working.

Assembly
You try to shoot yourself in the foot only to discover you must first reinvent the gun, the bullet, and your foot. After that’s done, you pull the trigger, the gun beeps several times, then crashes.

.Net
Microsoft accidentally shoots you in foot. Promises service pack to reattach your foot sometime in the next year. 18 months later you get service pack that removes your colon along with the rest of your foot.

CSS
You try to shoot your left foot, you miss 2 pixels. You try to shoot your right foot, you miss 1 pixel. Finally you try to shoot your head, you miss 10 pixels. Then you realize you’re using MS IE gun.

EJB
-Define a Foot interface
– Define a FootHome
– Define a FootImpl
– Define a Bullet interface
– Define a BulletHome
– Define a BulletImpl
– Define a Gun interface
– Define a GunHome
– Define a GunImpl
– Get the FootHome from the context
– Catch NamingException because you JNDI isn’t setup
– Get existing Foot from FootHome
– Fix error because you forgot to narrow the instance
– Create new Gun
– Be shocked that it actually worked successfully
– Create new Bullet instance
– gun.shoot(bullet, foot);
– Catch RemoteException
– Check the stack trace, find the actual problem
– Decide to go for Hibernate instead
– rm -rf *.java *.class

Enterprise Java
You build Gun and Foot objects in JSP/ Servlet model, you are asked to re-create Gun using Struts, then re-engineer it with JSF and later on asked to add Spring/ Hibernate capabilities. The gun which originally could shoot your foot now takes ages to load and shoot so that the bullet now comes out in slow motion.

About cuppajavamattiz
Matty Jacob - Avid technical blogger with interests in J2EE, Web Application Servers, Web frameworks, Open source libraries, Relational Databases, Web Services, Source control repositories, ETL, IDE Tools and related technologies.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: