Daily Archives: February 23, 2009

On Javascript frameworks

My PHP and MQTT post provoked a number of questions in the comments, via IM and on Twitter about why I chose Prototype over jQuery or Dojo (and I imagine there may be other choices too). I was also asked why I’m not using WebSphere sMash.

I have no particular affiliation or preference here. The simple and most honest answer is that I was looking for an easy way to make an Ajax call and the Prototype introduction made it sound really straightforward (which it is). I also wanted something compact, as I knew that in the long run this is going to be embedded into an iPhone webapp where (down)loading times will matter. I admit I’ve done absolutely zero analysis of the relative sizes of the three frameworks, but Prototype seemed OK, even though it could be smaller. [just checked, and prototype.js is marginally larger than jquery.js by a few bytes, not looked at dojo… but wow, OK, 90Kb is not so small!] Given that this is for an iPhone app I might be better looking at whether iUi offers what I need instead.

So I’m doing this partly for my own education – I’ve talked a lot about Ajax and Web 2.0 and stuff but have been away from web coding for a while. I may well try all three frameworks, and I’m interested in opinions. At the moment the only requirement is the ability to easily update an inline div in a page with the results of an HTTP POST call. I could probably hand-code the XMLHttpRequest call if I want to be super-compact about it, but Prototype seemed quick and convenient. I suppose on the Dojo side, I have a perception that it’s more about widgets and will take more of a mental jump for me to use. Thinking about it now, I assume it must have the core Ajax call stuff in there too, but again the Prototype sample just popped out at me and worked after a web search 🙂

As for the PHP vs sMash question – I have nothing against sMash / Project Zero, but I do have a small Ubuntu box which has PHP installed already, and I didn’t need to do much more to that (except get SAM added as a PHP module). Again, speed and convenience was pretty much the driver here.

Feel free to chime in with your thoughts. I have no axes to grind and I’m interested to learn!

Hail to the tribal chieftan

I’ve written more about this on my internal company weblog, but suffice it to say that I’ve blogged externally about my ongoing involvement with virtual worlds etc. and I’ve mentioned my minor Internet celebrity friend Mr Hughes on many occasions. I’m not going to go as far as to call him my Yoda, but he’s been a massive influence on me for the past few years.

Fare ye well.