JavaScript. What’s not to like?

I’ve been working on different projects and coincidentally javascript was an issue. I lean towards some more than others. jQuery being one of them. However I have used some other good libraries like MooTools, Prototype.js +

jQuery is very good at some things and, well, a pain in others. However, it is so good at what it is set up to do that I readily forgive its shortcomings. Like when you need to add/combine non-jQuery JavaScript. But I do love working with it.

The one library I tend to run into a lot is Prototype.js. To me it’s the premier JavaScript library, the one that started it all. It demonstrated that JavaScript libraries need not be huge bloated pigs and that they could allow for fast, flexible and, more importantly, crossbrowser scripting. It was truly the shizzle. Not to be confused with Sizzle, which is the new shizzle.

This brings me to the Dojo Toolkit which I tend to overlook because I’ve always viewed it as an embedded javascript for Java SDK’s that’s not intended for custom JavaScript. What prompted me to revisit Dojo is Sizzle. This is the new standalone CSS selector engine in jQuery 1.3 has been handed over to the boys and girls at the Dojo foundation. So it’s time for me to take another look at Dojo Toolkit and see if my reservations are unfounded.

Dojo Toolkit

The one thing I like about Prototype.js is that it is the same old JavaScript but now works on all browsers plus some really fancy bits. jQuery on the other hand is built on top and around JavaScript and is like a little island (a very sunny one with sandy beaches) in that anything you do is best be done on that island.
In this regard Dojo Toolkit is more like Prototype.js in that it is regular JavaScript on steroids and in my re-acquaintance I found it to be a joy to work with. A bit cleaner than Prototype and not with that jQuery namespace lock in.

So if I were asked to step off my sandy beach to board the good ship Dojo I wouldn’t mind a jot. When waving good bye to the tropical island paradise jQuery I’d be wondering how life will be sailing the seven seas with Dojo.

On tipping my toes in the water signs of trouble were quickly visible. Not so much with the Dojo base, which is great, but with it’s hairy siblings. Dijit and DojoX. To me these read a little unfortunately like ‘Da igit’ and ‘Botox”.

One the reason for looking at Dojo is that the company I work for, 42, is overhauling their production process by streamlining frameworks with Maven and the Atlassian Stack. I’ve got no idea what they were on about so I started to review the front-end side of things. It’s clear that some client-side widgets will be needed and in the case of Dojo these will involve Dijit & DojoX. These tools do great things and do them well but their doggedness of proprietary attributes in the static HTML just rub me the wrong way. So much so I considered to jump ship.
Dylan Schiemann does well to debunk some of the Dojo myths. However when he tries to tackle the whole ‘validation’ problem he comes out sounding like a fully qualified moron. He does, to be fair, point out that this mangling of HTML isn’t unique to Dojo so I started to realise that it’s not about who is the best but rather who is less likely to trash your house. From this point of view Dojo’s love afaire with proprietary attributes isn’t the worst punk rocker you could run in to.
As an API it is actually very good, it can enable true JavaScript Guru’s to do whatever it is that they do. Schiemann also points to an article about Dojo’s ability to be unobtrusive via an “embedded addOnLoad” trick. This did appease my web standards sensibilities, however unreasonable they my seem.

I’m holding on to jQuery for now but Dojo Toolkit will have my blessing on some of the larger projects I’m involved with. Now, fingers crossed that ‘Da igit’ and ‘Botox’ can get their act together.

Next entry: iPhone, youPhone, wePhone, apps not so much.
Previous entry: Spin this!