Cough, AJAX
Matt S Trout
dbix-class at trout.me.uk
Wed May 24 20:37:44 BST 2006
Dominic Mitchell wrote:
> Andy Armstrong wrote:
>> Can anyone recommend an up to date book on dynamic web stuff with JS?
>> Something heavy on accurate technical detail and light on fluff would
>> be splendid :)
>
> Seeing as nobody else has mentioned it, I personally quite like
> Prototype.
Prototype is a joke - it manages to effectively prevent you from using
any other javascript library by intentionally polluting global
namespaces to the point where doing an iteration on an objects
properties no longer works because prototype has stuffed extra crap into
there to "make things easier". Consider it equivalent to stuffing
UNIVERSAL:: with a couple dozen extra methods - this is going to mess
with your ability to use can().
The fantastic thing is that the viewpoint of the developers and a lot of
the users appears to be "that doesn't matter, you should just built
your other library in the prototype environment", which is clearly a
wonderful idea. Sigh.
$ is even better, given it's actually noted in the standard that $ is
allowed as an identifier explicitly for machine generated code so it
doesn't collid with real user code.
> From what I've seen of dojo, prototype feels a lot more lightweight and
> more like a functional language.
If you want to make javascript pretend to be something else, try
mochikit, which is also rather shiny.
prototype is lightweight because it's a collection of nasty hacks and
convenience methods thrown together into one file with a vaguely common
interface and referred to as a "library". Reminds me of cgilib, kinda,
except that prototype actually *looks* like it might be usefully
subclassable until you try.
And anyway, dojo's smaller builds (the IO and Ajax ones) are also pretty
lightweight. They just have actual design and engineering, which of
course has a slight overhead. The prototype.js source makes my eyes
bleed more than my first attempt at grokking NEXT.pm did, and is far far
less conceptually complex; dojo is actually quite pleasant to skim through.
> Whatever you do, though, make sure you use a library. No point in
> reinventing the wheel...
Although in the case of prototype.js the wheel is square, spiky, can
only be fitted to one specific model of Reliant Robin and refuses to
share the road with any other brand of wheel.
More information about the london.pm
mailing list