Thursday, January 10, 2008

Ext with Cows and jQueries

jQuery at first glance almost looks alien. It's cool though if you like being more productive by typing less. But to read the code, cut, copy & paste, emulate, before you get the semantics, is comparable to reading and writing hieroglyphics. Okay, that's a gross exaggeration. Reading and writing in (pick a type) hieroglyphics is probably not that hard. And the semantics might not be that hard to get, once you understand how they built the library from the ground up, and their motivations. I have to admit though, I have never touched their code (yet).

Mootools
is very cute. Quantitively, they showcase the most visual effects. Their example page is the best I've seen up 'til now. Highly copy&pastable, commented, the works. Their code resembles normal javascript code. But the main drawback is, the library does not play nice with other libraries. Mootools does not apply some type of namespace magic to distinguish their code from other objects in the global namespace. Ext is great in this respect. Every Ext component is called from the global object "Ext", which prevents probable global namespace collisions (with other libraries). It plays nice with everyone! While Mootools expects you to suck only on the teats of the holy cow. Ext even supports other libraries by building adapters to prevent code redundancy (aka fat).

Ext's example page isn't the worst, but it's not the best either. They do not comment sufficiently on their example code, making it hard to guess what the motivations are behind the code structure. They are stingy on whitespace symbols. They cram as much code as they can on one single line. Most of the examples try to nest objects inside objects as deep as they can, resulting in layers of layers of code, you have no idea when and why a certain block ends. The Ext guys could learn something from python, I quote the "Zen of Python" (try import this on the interpreter): "Flat is better than nested".
Why? Because this is called being friendly to your fellow programmer. You may think you're the end-all of all programmers, but people have to read this nested mess.

For isolated sites demanding cheap effects, Mootools, is probably the best choice. You can probably build some nice webapps with it, given that you do not stray from the cow.

Right now Ext deserves the highest praise for building webapps.

I changed my mind.

I'm going to donate my swap functionality to Ext, Mootools and jQuery. Starting with Ext.

No comments: