开发者

Choosing MooTools over Google closure?

I am in a process to select javascript library for our new web application. This app is not very UI heavy but has forms, reports, search, calendars, tabs and target multiple countries like most web apps.

We are a tiny team. Biggest concern is maintainability and readability of the code.

We are Python programmers. After evaluating many other javascript frameworks we have narrowed down to mootools and google-closure. We loved mootools syntax. It took us no time to learn. It's like Python. On other hand w开发者_开发问答e were stumped seeing private/public in google closure.

It's tempting to go for mootools however, I would love to hear from you about specific advantages these frameworks offer over each other.


This shouldn't be the accepted answer, but it may help a little. I've had to make a similar choice recently -- but for me it was between YUI3 and JQuery. My main priority was agility and modularity, which tipped me toward YUI3. Though a few things make me think a little every day about my choice:

  1. Code Assist in Eclipse. I got so used to it with Python, and have not gotten it to work with YUI3. It seems to be available for MooTools, but I didn't see it for Google Closure.
  2. Stack Overflow Support. There are >55000 questions tagged for JQuery, >700 for MooTools, but <50 for Google Closure and YUI3 (~600 for YUI).
  3. Distance from vanilla JavaScript. YUI3 seems to wrap almost everything away from vanilla DOM/JavaScript. This takes some getting used to, and I have the feeling that it is doing a good job of insulating me from lots of cross browser, optimization issues that I would like to not even think about. However it does diminish the value of more vanilla JavaScript tutorials and examples. I'm not sure how this weighs between MooTools and Google Closure.

(BTW. All in all, I still really dig YUI3.)


Well, its the whole argument between jQuery and MooTools. There is no true advantage of one over the other. From looking at the Hello World code for google-closure, Mootools seems to have a cleaner and quicker syntax. You also have to look at support. Sure, google-closure is supported by Google, but Mootools has a lot more searchable questions and answers and plugins as @mjhm said.

For maintainability and readability of the code, I would personally choose Mootools over google-closure. To me, Mootools is cleaner than google-closure

Mootools

window.addEvent('domready', function(){
    var myAnchor = new Element('h1', {
        html: 'Hello World',
        styles: {
            background-color: #EEE'
        },
    });
});

Google-Closure

goog.require('goog.dom');
function sayHi() {
    var newHeader = goog.dom.createDom('h1', {'style': 'background-color:#EEE'},
    'Hello world!');
    goog.dom.appendChild(document.body, newHeader);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜