[Catalyst] html::prototype syntax in new Cat version
J. Shirley
jshirley at gmail.com
Tue Jul 10 16:53:19 GMT 2007
On 7/5/07, John Wang <johncwang at gmail.com> wrote:
> On 7/4/07, Jonathan Rockway <jon at jrock.us> wrote:
> > The Prototype + Scriptaculous javascript framework is junk.
> > It doesn't work very well, the syntax is terrible, it will break other
> > javascript on the page just by being included, and the "cool effects" it
> > includes aren't even very good. There is absolutely no reason to use
> > Prototype.
>
> It might be useful to provide some specifics in helping people decide which
> JS framework to use.
>
> What do you mean by "It doesn't work very well"? Is this a performance
> issue (does it take a long time to load), a cross-browser issue (do more
> browsers not work compared to other JS frameworks), a security issue, etc.?
>
> What do you mean by "the syntax is terrible"? Is this regarding $() (which
> is also used by jQuery) or something else?
>
> When you say "it will break other javascript on the page just by being
> included" what kind of JS will break? Prototype.js was updated a while back
> to solve a lot of this. Have you run into this with a recent version of
> prototype.js?
>
> Do the other libraries have better "cool effects"? Which ones do you think
> are better in other libraries?
>
> Just trying to get some clarification.
>
> --
> John Wang
> http://www.dev411.com/blog/
One must rate JavaScript libraries using a very objective scale. The
categories I use are:
1) Robustness (quality of code)
2) Standardization (do they break existing standard JavaScript, other
libs, proper encapsulation?)
3) Efficiency (execution and rendering speed)
prototype.js and friends (scriptaculous, openrico, etc) are rated the
lowest in those categories. It fails the robust check by having
several things that don't play nice together, and also I've seen some
serious cross-browser compatibility issues. Standardization is
probably the biggest gripe people have with prototype.js. It doesn't
encapsulate and clobbers existing objects or adds on to them in weird
ways (like arrays). As an example, if you use some effects in
scriptaculous, Google Maps fails to work because of their mouse
capturing code.
Efficiency I'm not sure of, really. I've never bothered to check
because the other two categoreis are so dismally rated.
It's safe to say that inside of the Catalyst community, you will get
absolutely zero support if you chose to use Prototype. You are free
to ask, but you will get flamed for your choice. That's just the way
it goes.
If you want alternatives, here are the more favored solutions that
have proven themselves to be of a quality Catalysters will bother
assisting with:
* Dojo - http://www.dojotoolkit.org/
* YUI - http://developer.yahoo.com/yui/
* jQuery - http://www.jquery.com/
* Mootools - http://mootools.net
* MochiKit - http://www.mochikit.com
And, of course, there is Ext (http://www.extjs.com) which sits on top
of YUI and jQuery (and hopefully Dojo soon... and unfortunately
prototype.js, but it's a good way of getting your code away from
prototype and onto something higher quality.) and is more of a
"widget".
Picking a quality JS lib is just as important as picking a quality framework.
-J.
More information about the Catalyst
mailing list