By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

Using Prefax JS Libs: prototype, rico, dojo, etc

P: n/a
hey there

i've been buiding some web apps, and using my own scripting for coding
things like AJAX, XML extraction, etc.

i finally took a look on the web at js libraries, and boy are there a lot
to choose from. and a lot offer very cool/handy functions and effects that
i can definitely use.

i was wondering what your opinions are about these? i know prototype.js is
too large for basic purposes (and has the 'for in' problem - which i have
not yet used), but now that I see Rico being used as a part of the offical
'open source ajax' (http://www.cbronline.com/article_news.asp?guid=
97D640A5-48E2-4078-A131-D7256CA376DC ) i am tempted to go with Rico for all
my AJAX coding. lord knows it cuts down on time and bugtesting for me.

i was wondering what the thoughts were about these libraries (or mochiKit
etc.). i usually custom write most of my code, but I'm also against re-
inventing the wheel.

i don't want to start a flame war. obviously one answer is 'write it all
yourself - you will learn more that way', but really, that argument is not
going to be the winning one for me.

thanks.
Feb 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Good Man wrote:
i was wondering what your opinions are about these?
i don't want to start a flame war. obviously one answer is 'write it
all yourself - you will learn more that way', but really, that
argument is not going to be the winning one for me.


This is one of the 'holy war' topics in this group, so beware ;)

Some (like me, see my sig) think that the library approach is good because
it encapsulates reusable, tested code into a package which can be trusted
and used consistently. Others promote writing small personal widgets that do
specific things and create your own toolset which you inject into each page
which needs it. Others say write code from scratch for each specific
situation because it needs to be as efficient and page-specific as possible.

If you discuss the topic of whether or not libraries or 'block box' scripts
should be used, you surely need to address questions like:

1) Who will be implementing them?

2) What is the target webapp (public site, intranet, personal site, etc)

3) How generic is the functionality required?

4) Is there any benefit in solving the problem yourself if someone else has
already done the same work?

Here are some of the common arguments against libraries, and my response:

---------------------------------------------------------

COMPLAINT: Libraries contain extra code that a given page may not need. This
adds to page bloat and is bad for the user who needs to download extra code
which isn't used on the page.

RESPONSE: Most browsers cache js libraries, so the code isn't delivered on
each page. Most pages have images which may total to 50-100k or more on the
page, so a 25k library is not any more fluff than an image. In many
situations, page bloat is not even a concern because the app is on an
intranet, etc.

---------------------------------------------------------

COMPLAINT: Developers who use libraries should learn how to do things on
their own.

RESPONSE: In an ideal world, that's possible. In a real world with deadlines
and zillions of technologies, a web developer can't be an expert in
everything. Javascript can be a bit daunting to many people. Using libraries
eases a lot of the burden.

---------------------------------------------------------

COMPLAINT: Many libraries on the web are horrible.

RESPONSE: This really isn't a complaint about the concept, but many librs
out there _are_ horrible. That should encourage the better developers to
write libraries which are high quality so that the bad libraries will not be
used. But if library X says it solves problem Y, and a user tries it in a
single browser and environment and it looks like it does, then he'll
probably use it - not knowing that it might break in other situations. I've
tried to get a group of expert developers together to write small
special-purpose widgets and task-specific libraries which could be regarded
as the "official" toolset recommended by experts. But the elitist attitudes
of so many of the 'experts' (in this group specifically) is such that they
don't think the average developer deserves their help, and should instead
learn everything from scratch. I've written my own libraries (see sig) and
attempted to make them worthy of being accepted as a "standard toolset" but
a single person can never do as good of a job as a team of pros.

---------------------------------------------------------

COMPLAINT: Many libraries try to solve a general problem, but fail for some
specific situations

RESPONSE: Just because a library tries to solve a general problem doesn't
mean it _must_ solve every possible permutation. If the library doesn't
worth for a specific task, then either the library needs changed or a
different solution should be found. However, a library which solves the vast
majority of conditions is certainly valuable.

---------------------------------------------------------

Discuss! :)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Feb 3 '06 #2

P: n/a
"Matt Kruse" <ne********@mattkruse.com> wrote in
news:ds*******@news3.newsguy.com:
Good Man wrote:
i was wondering what your opinions are about these?
i don't want to start a flame war. obviously one answer is 'write it
all yourself - you will learn more that way', but really, that
argument is not going to be the winning one for me.


This is one of the 'holy war' topics in this group, so beware ;)


thanks... funny enough the one library i DO use so far is your
"validations.js"

i guess its a personal choice.

thanks for the input.

Feb 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.