jQuery vs YUI

Posted: 9th October 2010 by Lukasz Iwanski in General

this battle is happening every time with everything..

jQuery vs YUI
DirectX vs OpenGL
Intel vs AMD

the same products offers the same – more or less – functionality. Some of them offers more flexibility other are simpler in implementation. Finding golden mean is always the hardest part.

As a front end developer in every single project that requires – “I want to make it fadeIn” or “after 10 seconds rotate it” or “on hover make it shinny” – I have a choice – make it on my own by javaScript; I need to be honest on this one – I hate it! – it causes always problems – browser may turn it of and something will not work – it is totally against usability.. but what can I do.. I have to use it,
We have to do, what we have to do.

Anyway.. as we know there are two main javaScript libraries:

  • jQuery – supporting sites such as: Google, Mozilla, WordPress, Drupal
  • YUI – developed by yahoo and connected with all yahoo stuff including flickr

In my personal opinion jQuery is winning this fight.. it is much simpler to do stuff in it.

1
2
3
4
5
6
<script type="text/javascript">// <![CDATA[
    $("a").click(function () {
          $("span").fadeIn("slow");
        });

// ]]></script>

fadeIn effect for span tag after click on a link.

YUI3 the fadeIn function

1
2
3
4
5
6
7
8
9
<script type="text/javascript">// <![CDATA[
var animShow = new Y.Anim({
node: div,
from: { opacity: 0 },
to: { opacity: 1 },
duration: 0.5
});
};
// ]]></script>

then it needs to be triggered by

1
animShow.run();

someone may say: yes but it is more customisable and flexible – that’s true – if we want to develop advanced system with custom functionality I would agree go for YUI.
but simple tasks and standard procedures and standard processing like fadeIn, tabs or slider – I prefer simplicity – jQuery.

the other thing – jQuery is one! with versions type. YUI – there are 3 main bases and each of it has bunch of versions! – like freaking IE! – don’t let me start at this one! This will be topic for next note.

quite useful thing about yui – it marks tags if is loaded correctly -
most annoying thing about yui – it marks tags..

during making a research to compare this two frameworks I discovered quite nice third alternative:
Dojo toolKit – I’ll make research and I’ll get back.

my point is:

-do not overcomplicate things if you do not has to – use simplest possible solution – that will allow you to avoid not necessary effort, costs and stress.

L.

Related Posts:

  • No Related Posts
  1. agusia says:

    i miss u already