views:

527

answers:

3

jQuery 1.4 vs YUI3,

which to use and why?

+4  A: 

I like jQuery 1.4: clean, concise, chainable, includes pretty much everything I've ever needed, has a huge library for pretty much everything else.

I think it's a great library, small, compact, etc...

YUI is a great library, it offers a ton, but when I want to include things on a page or access a widget, I just have a namespace 20 characters long in some cases.

Notice how many times those statements include the word I...that's because it works for me. You need to do yourself a service and investigate both (and the other frameworks for that matter) and see what syntax you prefer, which one feels better to you (and/or your team if you're in that situation).

Also, be aware there are lots of options besides these two.

Nick Craver
+1  A: 

I think the purpose of the two is very different. YUI is like legos where you have the basic building blocks, it takes longer to build solutions, but then you can template them and reuse them very nicely. I think YUI is better suited to an enterprise environment (a large website) where you have a lot of opportunity for code reuse and you may have similar elements used across a lot of different pages.

jQuery is much quicker for quick one-time solutions. If you don't have similar modules to use from page to page I really recommend jQuery. It has a smaller learning curve and is quicker to implement for one-time solutions.

Jamis Charles
A: 

Since you are already using jQuery 1.3 (as your comment states) upgrading to 1.4 seems like the sensible thing to do, you will get a speed boost and hardly have to change any code.

Unless you have a specific reason to change, no need to rewrite the code using a different library.

Pat