We’ve been working with YUI recently. There is plenty that is good about it - we were originally drawn to it because of its obvious amounts of documentation, examples, blog and the backing of a big, big company in Yahoo! (and their suite of javascript luminaries).
Its been quietish on the YUI front, recently however, there was a point upgrade, but I do think we over-estimated Yahoo!’s ability to keep the library bubbling along. I think there is a difference between the priority Yahoo! places on YUI when compared to dedicated library development efforts (prototype, jquery, dojo all come to mind).
The documentation in use comes fairly short of acceptable. I will try to elucidate on why because I don’t really want this post to be anything other than constructive. Afterall, YUI did end up achieving what we were after however I felt we probably ended spending too much time trying to learn the library and the quirks of its construction.
As part of the documentation an overview or survey of the library would have been great - many features we found too late and spent time retrofitting onto code we had already written. This process helped fix browser compatibility issues but ideally we would never have come across these if the prefered ways for changing styles and retrieving elements were highlighted. Further browser compatibilty issues could have been prevented with some more defensive programming within the library - there is definitely wrong input that you can put into the API which will yield js errors from within the library.
Other frustrations included examples which appeared to have their own custom additions to the library with little or no explanation eg. the DDPlayer objects in the Drag and Drop modules.
I also found the DD module had a few too many assumptions when it came to its events.
Drag events can work in a simple point mode (ie. the target is wherever the mouse pointer is) and intersect mode (events such as DragEnter, DragOver and DragOut get an array of targets which you can use to determine which you want to interact with). Intersect mode is, I believe, a preferred method because the drag item becomes the mouse cursor. This means users will expect interactions to occur with the item rather than the mouse cursor.
The problem I found was that the library did not pass me the true list of items I was over. It appears that it was caching items already found by earlier events. This was frustrating because now I need to mirror this caching in my objects and am therefore needing to peer behind the curtain to see how the library works.
Early on we found a bizarre class notation which was used in some of the YUI modules. It puzzled as to why use this over the more standard javascript approaches to defining objects (a js strength/weakness is its flexibility). It appeared to be used where you might usually use a static class or the singleton pattern in other languages.
Thankfully, only an hour after a colleague and I puzzled over this Dustin Diaz posted an article which illuminated it fully for us. The exposure of many Yahoo! staff via their blogs continues to be a compelling part of the support network for this library (and our saviour twice now!).
I think that YUI needs the continued support of Yahoo! to continue the good base that has been established. The library has clearly facilitated some great developments for Yahoo! with some very impressive product releases of late. The gains are measureable but the potential future gains from continuing to support and improve the library are also very real. Don’t do it for us - do it for your own developers. And then put it out to us 