I haven't done web development for about 6 years. I'm trying to get back into it and there is a lot of new stuff out there. I've chosen to write my next project with Perl and Catalyst.
I keep hearing about various JavaScript and CSS frameworks. I know very little about these frameworks so maybe this question is overly broad and open ended.
What are the strengths, weaknesses, and popularity of the various frameworks? Should I be using YUI, JQuery, neither, or something else?
Firstly, it's probably worth perusing Which Javascript framework (jQuery vs Dojo vs … )?.
Secondly, there are two broad categories of Javascript framework:
Rich: made for creating so-called Rich Intenet Applications, they are typically aimed at creating experiences much like a desktop applications with sophisticated windowing GUIs. This includes, but aren't limited to, YUI, Dojo, ExtJS and SmartClient;
Complementary: these are more focused on improving a traditional Website experience rather than replacing it altogether. These include jQuery, Prototype and others. Some might point out that jQuery has jQuery UI but this is a barebones widget library at best and completely incomparable to, say, YUI in terms of out-of-the-box user interface capabilities.
So the first thing you should ask yourself is: what kind of application are you creating?
Personally I think you can't go wrong with YUI or jQuery, depending on your answer.
Why not use both? I have on a couple projects.
jQuery's size is small. You can use the minified version from google's open ajax libraries, and since many people already do this, there may be no download at all b/c it may very well already be in your user's cache.
As for YUI, they have a great configurator for getting exactly what you need. Also their documentation is very thorough and their widgets top notch in compatibility.
Having worked with both, jQuery's strength is it's speed and flexibility to do a lot of tasks. YUI's strength is it's top-notch, ready to use widgets. Both projects have written very solid code that will not interfere with each other. Both projects have worked hard to be compatible across all A grade browsers and careful not to trash the name space - which is better than I can say for some other frameworks.
I personally recommend jQuery. It is extensively developing, fast, powerful and small (comparing to YUI for example which is big). It has jQueryUI library with customizable themes for interface elements and many plugins.
I have used JQuery, however you really should look into trying both YUI and JQuery to see how they work and whether or not they suit your needs.
YUI: http://developer.yahoo.com/yui/
JQuery: http://jquery.com/
I personally find the JQuery documentation to be excellent. I have not really given YUI a shot.
JQuery is the more popular of the two frameworks from what I can tell, I used JQuery at my last job and have seen heavy use of the framework.There are many plugins that have been developed for JQuery and examples can be found all over the web. Again though, I've never really played around with YUI.
Here are benchmarks of MooTools, JQuery, Prototype, YUI, and Dojo on different browsers.
First question you should ask yourself is: what do I need from this framework? JQuery and YUI, for example, take two totally different approaches. JQuery itself is pretty much a simple querying library that uses XPath selectors to navigate the DOM tree and apply transformations to its nodes. That being said, it also has tons of libraries (such as JQuery UI, as well as hundreds if not thousands of third party ones) that contain UI widgets, nifty animations, and other ridiculously cool things you never knew you could do so easily with Javascript. It's a functional library and doesn't really deal with objects.
YUI, on the other hand, goes the opposite direction. Primarily it's a UI library, meaning it exists to provide you with functional UI widgets (buttons, trees, panels, dialogs, etc). It also has additions and support/utility objects that can be used to do the same sort of XPath DOM tree querying as JQuery, but that's secondary. It's also pretty object-oriented.
The link cletus posted is also a great place to start.
来源:https://stackoverflow.com/questions/846538/javascript-frameworks-and-css-frameworks-jquery-yui-neither-or-something-els