473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
2 1728
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Andy Baxter | last post by:
Can anyone recommend a good online guide to using objects in javascript? The book I bought (DHTML Utopia) suggests using objects to keep the code clean and stop namespace clashes between different...
3
by: KishoreSainath | last post by:
Hi All, I would like to know whether we can use Yahoo UI Library and Prototype in the same application/page. Has anybody experienced problems in using these libraries in the same page? I...
1
by: hedgehog | last post by:
I've always been a do-it-yourselfer when it comes to referencing DOM, doing lil animations and Ajax queries, etc, but I thought I'd give someone else's toolkit a spin. Aside from sorting out...
5
by: plsHelpMe | last post by:
How to create dynamic javascript arrays using dojo toolkits Hello frens, I am in a big trouble. My objective is: I am having some categories shown by differnent radio buttons, on the click of...
15
by: plsHelpMe | last post by:
Hi All, I am having a problem. I am using DOJO toolkits to fetch some data on my webpage. Now suppose if i leave my webpage for some time and the session gets expired and then i try to click on...
7
by: raknin | last post by:
Hi, Hi, Now that I am handle the way of use the dojo combobox I moving to the next stage. What I want to do is updating a second combobox automatically when a value is selected in the first...
5
by: gaya3 | last post by:
Hi, can anyone find error in the following example <%@ include file="JspBean.jsp" %> <%@ page import="java.util.*"%> <html> <head> <%
83
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about...
1
by: kokababu | last post by:
I am trying to load dojo module from different domain; such as dojo.parser, dijit.form.TextBox etc. <html> <head> <script type="text/javascript"> djConfig = { isDebug: true,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.