Web Applications
2 October 2006
Riding the wave of hyped-up “Web 2.0” online applications comes a related wave of developer tools and libraries aimed at making modern online development easier. On the server side Ruby on Rails gets by far and away the most hype – and it certainly has its merits, but also strong negatives (like difficulty in deployment) – but it’s certainly not unique – there are ever larger numbers of rapid development frameworks for almost every language out there.
Similarly, there’s a huge proliferation of client side libraries concerned with the GUI and end user experience. The ones I’ve been looking at have all been Javascript based, but there’s also some interesting work going on using Flash and Adobe’s Flex platform – while I’m not normally a huge flash fan (as it’s abused more often then used appropriately) I think there’s interesting possibilities when using it to build online applications. Flash’s traditional problems – accessibility, usability and inflexibility – seem to have been solved if you have a competent Flash developer, and Flash seems quite inherently suited to web app development, with its rich set of user interface abilities.
Back to the Javascript libraries, there are a few main contenders. By far and away the most popular ( according to a poll on Ajaxian ) is the Prototype framework. This isn’t hugely surprising at it’s built in to Ruby on Rails, so I’m guessing a lot of people are using it as they’re getting a lot of functionality without having to write the code themselves (RoR has several methods of integrating the server-side code with the client-side code – it’s all quite nifty). It’s also one of the most basic of the frameworks, adding some fairly simple things to the language making it a good foundation to build your own code on top of.
Indeed, Script.aculo.us – the second place in that survey – is based on top of Prototype and adds a nice additional set of more interface-lead functionality, with effects and basic widget functionality. I’ve used Script.aculo.us on a couple of projects to get a bit more movement into normally static sites, and it works really well. However, it does suffer from what almost all of these libraries suffer from – not very good documentation. When going through that first getting-to-know-you stage with all of the libraries I’ve tried so far, you’ve really got to employ more guess work then you should do – simply because the documentation is often extremely lacking, often being no more then a few bits of example code.
And talking of bad documentation, that leads us straight to Dojo. Now, don’t get me wrong Dojo fans – Dojo is great for a number of reasons I’m just about to get into, but documentation isn’t one of its strengths. Part of the problem seems to be that Dojo is undergoing rapid development, so documentation that was originally written is now out of date and needs redoing. This is coupled with the fact that vast stretches of the basic functionality seem to be undocumented – while you can look at the source when you’re first starting with a framework that’s really no substitute for good docs.
Once you’ve got to grips with it, though Dojo really shines. It offers a complete package – unlike Prototype’s bare-bones approach, or script.aculo.us’ focus on effects Dojo focus’ on allowing you to very quickly make GUI based web applications. To this end, you can quickly add elements such as split views, sortable tables, menus and more to your pages without having to write any javascript, and this is baked up by a strong foundation that handles ajax requests and all the other additional communication functions (such as event handling) your app may need. Dojo also seems to be right on the cutting edge of javascript development currently, with things like the new client-side storage module they’ve developed, which can really open up new possibilities in app design.
Needless to say, I’ve become very impressed with Dojo.
Of the others, newcomer YUI is the most interesting looking to me. For a start, it has a huge amount of resources behind it – Yahoo are basing all of their sites on this foundation – so it’s good, stable, well documented code. My only worry is the file size of the library – the bigger the file size the more your users have to download – while it’s comparable to Dojo, Dojo do some fairly cleaver things with packaging, compression and dynamic loading that really help reduce that initial hit. In addition, YUI isn’t quite as fully featured as Dojo (yet) – I’m sure it’s only a matter of time, however – then it gets really interesting.
All in all, it’s a good time to be a web developer; all these frameworks and libraries – both client and server side – really help reduce the amount of code you write and hence make it a lot easier to write interesting code – there’s no point re-inventing the wheel…
David Emery Online