Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ron Savage (5224)

Ron Savage
  (email not shown publicly)

Journal of Ron Savage (5224)

Friday October 24, 2008
03:16 AM

Javascript libs: Dojo 'v' Ext 'v' jQuery 'v' YUI

[ #37726 ]

Since we all think differently (at least to some degree) in the same way that we have
different tastebuds etc, there cannot be one Javascript library which suits every user.

So, when I say I prefer Yahoo's User Interface (YUI) library, I don't intend that
everyone should adopt it, only that of the ones I tried, it's far and away my favourite.

As a test, I wrote the same code using each of these libraries (except jQuery),
and here I report my experiences.

o The Dojo Toolkit at

To start with, Dojo looked promising, but as with Ext I soon found the documentation
inadequate, and I wasn't really doing anything sophisticated.

Comments by other users on their forum helped significantly, but I immediately felt
that if every step was going to require scanning many posting to see how to actually
do anything, progress would be painfully slow.

So, exit Dojo.

o Ext JS at

A lot of Ext is set up with data structures, what Javascript calls object literals.

It's a very elegant way of doing things, but there's a catch.

To process these structures, your page needs to include 575,000 bytes of Javascript,
for that's the combined size of the Ext libs.

This Javascript can be thought of as a code generator, in the sense that it processes
the object literals and turns them into executable code.

Of course, the ideal situation is that you send all that to the web client as
infrequently as possible, and thereafter you use Ajax to do the work.

Their web site does offer a way of building a customized set of features, which
would have to be repeated each time you incorporate new features into the set
you are using.

The major disappointment for me was that as soon as I wanted to do something not
involving a default, I found the documentation often very superficial.

As with Dojo, I found useful comments from other users' feedback, but they had had
to scan the source code to determine what was possible, and how to do it.

Lastly, the docs are confusing in suggesting what files to include in your web page,
since one of the file names mentioned exists in 2 versions in the distro, and the
docs don't tell you which one to use. A quick test using one failed, where the other
succeeded, but it was another, albeit small, black mark against Ext.

But, this is all too much like hard work, so ... exit Ext.

o jQuery at

jQuery is based on the assumption you like endless method chaining. If you don't, too bad.

It's a specific way of designing syntax which allegedly matches the way we think.

As it happens, that for me is a huge turn-off, so look elsewhere for a review.

As an aside: There is a beautiful Perl module called accessors, which comes in 2 versions,
with and without method chaining. Obviously I use the latter.

o YUI at

Now, this one I like.

It can be included file by file, depending on the features you want, or you can use the
YUI Dependency Configurator to get a customised set of files.

A major plus for me was the extensive documentation, which spells out many examples
in a way which shows how simple code can be progressively extended.

Using YUI I've been able to produce a beautiful application, although as I indicated
above, I assume experts in the other Javascript libraries could have done the same.

What matters to me, and indeed to each of us, is that we feel comfortable with our
chosen tools, and for me YUI is the best. YMMV.

One last comment: the Perl module JSON::XS is highly recommended because it provides
an extremely neat and simple way of converting a Perl data structure into exactly the
format your Javascript code can gobble up and utilize, e.g. as part of an Ajax transaction.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Check out Joose [] too.

    It's unlike the three in your post in that it's purely an object system for JavaScript, and an incredibly flexible one at that. It can work in conjunction with the interface tools provided by jQuery, YUI, etc., and I've found it quite helpful for maintaining any serious kind of state or logic client-side.
  • Have you tried MooTools [] ? I've seen some pretty nifty GUIs developed on it, and it seems pretty compact.

    For a more professional solution (wo/ nasty Flash-ness), you might look into TIBCO GI [], tho it has some of the same bloatware issues as ExtJS

    I agree Dojo's docs to date have been appallingly bad...but now there are several print books on it (I haven't read any yet, but its on my TO DO list).

    And I also agree YUI is probably the most accessible of all, probably because the website has really nice examp

    • No response from the MooTools link.

      Exit MooTools.

      ThinWire: I abstain from Java, and am only looking for Javascript stuff. Now, in the ThinWire FAQ I see
      'Thinwire is not designed to use custom JavaScript code elsewhere'. Oh. (By 'elsewhere' I assume they mean 'anywhere').

      Exit ThinWire.

      Now: QooXDoo.

      Yes, this is more suited to my way of thinking, and a demo like this (go in, I'm afraid, via Documentation/Getting started/Snippets/Demo browser): []

  • I don't like method chaining either, but you can program jQuery without it. It's so much easier to use than YUI. I think you should give it a chance.

    • The phraseology I used implied it was just the chaining that I don't like (true) but the other thing which put me off was the sheer quantity of code (in the demos, admittedly) to achieve results.

      It reminded me of assembler (shudder) and Tk (mega-shudder). A lot of code for a small effect.

      I, like you, and like everyone, either are forced to use a particular package in a specific situation, or choose something we like. And this I don't like.

      OK. I've had another looks at jQuery's docs, specifically the Tab int

  • I was really happy with Rico (, which is built on prototype. However, I really only had a single application - which was a dynamic AJAX table with sorting and filtering. There is not much of a perl API. I did end up reimplementing it (just a quick database connection).
    • The home page of OpenRico responds, but clicking on Demo gets no response.

      And from their archives, it looks like development stopped in Jan 2008 :-(.

      Exit OpenRico.

  • I've been using jQuery and love it. I find coding with it clear is simple, there are plenty of plugins and great docs online.

    It's also been easy to write our own jQuery plugins.

    Sometimes I use method chaining with it, but often I don't. I have found it useful at times and appreciate the feature.