views:

850

answers:

6

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?

+2  A: 

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.

Sergei
+12  A: 

Firstly, it's probably worth perusing Which Javascript framework (jQuery vs Dojo vs … )?.

Secondly, there are two broad categories of Javascript framework:

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

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

cletus
+2  A: 

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.

Benchmarks

AlbertoPL
+2  A: 

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.

Marc W
jquery ditched xpath selectors some time ago. Uses pure css selectors now.
redsquare
A: 

I suggest that you go for the one that is best documented, has plenty of user-contributed code and supports plugins. That'll save you loads of time. jQuery is pretty good in this regard.

Salman A
+4  A: 

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.

Keith Bentrup
Just though I would add a couple links ...current: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.jscheck for updates and others: http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery.The more people who use these, the better.
Keith Bentrup