November 2nd, 2006

fuck code

I work in a factory, don't wanna be late

I've been doing a lot of Java recently. Once, long ago, I used to do Java as my day job and always found it oddly constrictive. In the intervening half decade plus my contamination^W exposure to scripting languages has only deepened so this time around the constrictiveness has been upgraded from "Like an overly tight pair of jeans" to "Like having my balls crushed in a vice".

Part of the reason is, I think, the strange and almost religious reverence of Factory classes. I often joke with my flatmate, a paid up member of the Cult of Java, that in most sane languages you can increment doing any of the following


in Java it's more likely to be

    Integer            i                  = new Integer(1);
    IncrementerFactory incrementerFactory = IncrementerFactory.getInstance();
    Incrementer        inCremenTer        = incrementerFactory.getIncrementer();

Oh how we live the rock'n'roll lifestyle, sitting round the fire, swapping programming jokes.

I understand the point of factories, especially since, I'm lead to belive, you can build apps using Beans etc etc that will automagically scale from one machine to a massive, n-way failover clustered farm, but sometimes it may go a little far.

Yesterday I was attempting to get rid of all warnings from my Java app because the little yellow exclamation marks! in Eclipse have the same effect on me as an single upside down book in a bookcase does on an OCD sufferer. I put this down to my years working at the big Y! or possibly too much time playing Metal Gear Solid (most. overrated. game. ever[*]). I finally get down to my last set.

I had been doing

    Date date = new Date()

but those methods are now deprecated so instead I have to do ..

    Date date = new Date();
    Calendar cal = Calendar.getInstance();

which for reasons I can't quite vocalise, offends me at a nigh-spiritual level.

Ah well, back to tracking down synchronisation bugs that peg my CPU at 100% and render my machine unusuable for 20 minutes.

Bonus points to the person who can tell me which song the subject of this post comes from.

[*] Apart from possibly God of War