Closure Library or YUI 3
Asked Answered
D

4

5

I'm architecting an enterprise web application using python, django. My final decision to make is which javascript library to use. I'm thinking about using Google's closure library or YUI3. Most of the development, I've used jQuery.I can code fast with jQuery but doesn't seem right for enterprise use.

YUI 3 seems pretty good. It includes most widgets I want to use, but Closure library does almost the same. Better offer with Closure library is they have Closure Compiler, but seems like Closure requires to write much more code than YUI 3. Documentation from YUI 3 is pretty good too.

The application will be for both web and mobile devices, so the library should not break in mobile device such as Android or iPhone.

If you were me, what decision would you make?

Dimitris answered 24/9, 2011 at 0:33 Comment(4)
Seems like no-one is having concern like me.Dimitris
Why the heck isn't jQuery right for enterprise use? Its only the most widely used framework in the world.Demit
@Demit Is width of use a good measure of quality for any subject and appropriateness of its use in given situation?Carvel
@Demit people tend to like jQuery because they are easy to write and lots of plugins out there. But from my experience, those plugins had trouble when upgrading the core jQuery library, so we had to either modify the plugins to get it working or drop and try to find new plugins which works with the core library. As time goes, it was getting messier and messier.Dimitris
W
2

I'd go with YUI 3. Especially if the only reason you're considering Google's Closure is the compiler. As this works well in YUI 3, with much better compression than the YUI compresser. I'm sure it doesn't do as good a job as it could with Closure code, but that's pretty hard to test.

The modular framework in YUI 3 is awesome, and there is enough sugar to give you a tooth ache without being too heavy. Yahoo use it for all their sites, and they have a strong emphasis on performance (so it can't be all bad).

Weathers answered 27/9, 2011 at 23:44 Comment(0)
C
7

Disclamer

I mostly draw on comment about jQuery in enterprise environment and since I lack experience in YUI, I can not give any conscious advice for [not] using it over Closure.

But in lack of any other answers I'll share my experience with Closure.


Closure library

As for Closure library, which I have been using for last few projects but am, by no means, expert at it, I can say only good things.

Library provides the core components you need when building any kind of UI. But, unlike jQuery, it does not come with trillions of "ready-to-deploy" plugin-in scripts, or as some would say, with no batteries included.

It's got basic events, controls, xhr, dialogs, form components etc., and by my account the most important thing, namespaces (or at least something looking like them...).

With this you can create your own custom UIs limited only by your imagination and the power of JavaScript (and JS is very powerful language even if it does have its own annoyances).

And with help of Closure compiler, which not only minifies the code but it excludes all unused code, does type checking, gives warnings useful for debuging and so forth, it looks like solid foundation for building large applications ground up by teams of any size.

In my opinion, main reason for using Closure over jQuery in enterprise projects is consistency. Plugins are awsome but they tend to include inconsistency at all levels, either programming practices, visual styles and structure, performance, usage, you name it. Removing these small inconsistencies on large project can waste lot of time.

So in conclusion, if you have large project needing custom UI and a lot of flexibility Closure is the Right tool for the job. And with "namespaces" it even feels all Pythonish.

P.S. We also use Django on server side.

Carvel answered 29/9, 2011 at 21:51 Comment(0)
C
4

You have touched on most of the important aspects here, the type checking, minification, namespaces, but I would like to add a few more. Alongside is the templating sollution they offer, which is not only super fast and has full internationalisation support, this mixes in and compresses with the library. It also compiles down to java code so you can render on both the server and the client from the same template. Then there is the component architecture which has a complete livecycle, seperates renderers from components, (if you are familiar with swing or flex you will get the idea), it has two models, one is client side rendering and the other is decoration which plays beautifully alongside the server side rendering.

The testing sollutions are well defined and now the We have thousands upon thousands of lines of javascript and without closure it would have been an unmaintainable mess IMO.

Chemosynthesis answered 29/1, 2012 at 12:2 Comment(0)
W
2

I'd go with YUI 3. Especially if the only reason you're considering Google's Closure is the compiler. As this works well in YUI 3, with much better compression than the YUI compresser. I'm sure it doesn't do as good a job as it could with Closure code, but that's pretty hard to test.

The modular framework in YUI 3 is awesome, and there is enough sugar to give you a tooth ache without being too heavy. Yahoo use it for all their sites, and they have a strong emphasis on performance (so it can't be all bad).

Weathers answered 27/9, 2011 at 23:44 Comment(0)
D
0

In the tests I made, Google Advanced Compress is the better, and after the the Yahoo! YUI Compressor. You can make the tests here: http://jsperf.com/closure-vs-yui

Dominiquedominium answered 17/1, 2013 at 21:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.