I first learned of dojo. I missed all the hype around jQuery, and blissfully started using one particular feature of dojox, the grid. To date dojox.datagrid is the only table based UI element that allows for read/write, each cell can call it's own UI for editing. I was able to make a change to the table on the screen, and have that call a php script that would write the change to my sql database.
jQuery, is rather different. This library stood out because of it's great selector. If I had to pick a favorate thing of jQuery, it would be selecting part of the DOM. While dojo let me replace standard UI with the dojo theme, there are now four themes to choose from, jquery does it in a way that keeps your code valid html. The advantage to dojo's technique is I can make a auto-complete element that calls an external URL without writing any code. jQuery does not make it so easy.
I recently decided I wanted to give YUI (Yahoo UI) a try. There is one thing you notice right away that's unique with YUI, it creates instances to do all of it's work. To fade out looks like this:
YUI().use('anim-base', function(Y) {
var anim = new Y.Anim({
node: '#demo',
to: { opacity: 0 }
});
anim.run();
});
Other libraries would make this much simpler, see the same code in jQuery:
$('#demo').animate({opacity: 0 });Do not think that one way is better than another just because it takes less code to do. Like valid html, making instances in javascript creates scope. If a project is being done by a large team, each team member only need to worry about individual instances, not the full code.

No comments:
Post a Comment