What JavaScript framework is the least evil?

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.


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 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...


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 script.aculo.us 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.

That's the real reason to pick up these frameworks - to implement code you could create, only better. I would never be as bold to state, I could do as thorough a job as 100 contributor the frameworks have.

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

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


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

链接地址: http://www.djcxy.com/p/83938.html

上一篇: 我怎么知道一个变量是否包装在jQuery中?

下一篇: 什么JavaScript框架是最不可恶的?