views:

170

answers:

4

I'm not a huge fan of the JavaScript frameworks that are out there today. I think a lot of the libraries could be written better, are chosen for a project because of favoritism rather than understanding the requirements of the problem at hand, and some JavaScript developers come to depend on them too much to the point where they are jQuery or dojo programmers, not JavaScript programmers. Alas, that is one person's opinion and the fact is JavaScript frameworks are a part of life. So, here's a new take on an old question: Which JavaScript framework is the least evil? That is to say, which library most closely adheres to best practices? Considering jQuery for a moment, it employs browser sniffing and doesn't use new for constructors. It is very popular and some may judge it the best by some standard, it disregards what has come to be accepted as best practices in those cases.

Edit: Please just don't say jQuery or YUI or dojo or whatever. Please say which but also provide examples.

A: 

MyLibrary

RoToRa
It calls itself an "Ajax library". I wish there was a -1 button for websites
Matti Virkkunen
A) It doesn't. It says its a "browser scripting library (also known as an Ajax library)" referring to the fact that many people (who don't know better) consider "JavaScript library" and "Ajax library" to be the same. And as with many frameworks Ajax is only a small part that can be left out if not needed. And B) What is so bad about "Ajax library"?
RoToRa
"Ajax" has come to mean a dozen different things, mostly due to mis/overuse. I prefer to avoid the term altogether. Let's leave buzzwords for marketing.
Matti Virkkunen
I completely agree with you. And IMHO the wording on the site, the structure of the library and the presence of the builder acknowledges exactly that.
RoToRa
A: 

My vote is for jquery. With noConflict() you can use multiple versions on the same page, easy learning curve with css selectors.

derek
did you even read the question?
Timothy
+5  A: 

Well - I used to be of the same view, never really used JS libs as - well, I can do it myself. But in my job I was forced to use Jquery.

Previously to that I would use Prototype and Scriptalicous (erm... Spelling...) and liked it because of its minimal injection into your daily workflow.

But saying the libs are evil isn't really something I agree with. Looking at the code of many libs, they are well written and concise. They generally fit all browsers without bugs. Thats the real reason to pick up these frameworks - to implement something you would... properly. I would never be as bold to state I could so as thorough a job as 100 contibuters the frameworks have.

Additionally to that, its the time these JS libs swallow for you. If I can shave 3 days of creation and debugging of a project because someone has happily done the exact same thing for me, thats great! Then hopefully I can give back on day.

I don't believe there are evil frameworks, just different.

Glycerine
+1  A: 

Lol. That surely is subjective, but anyways...

Personally I think YUI is the least evil as it has Douglas Crockford himself advocating it. ('nuf said)

Although, I don't really think that other frameworks are necessarily evil...

jQuery seems to go for easiness of use (just include jquery.js, copy-paste some samples, hack a little bit and you're done).

Dojo goes for completeness (for what I can see) implementing many utilities (much like apache commons for java), and a broad list of widgets, grids and charts.

Then there's Prototype which I'm not really fond of it since it f*cks modifies the native objects.

There's also Ext JS that has lots of widgets and visual components to build full fledge applications, but I'd stay away...

Pablo Cabrera