选择 MooTools 而不是 Google 关闭?

发布于 2024-10-09 09:56:33 字数 346 浏览 3 评论 0原文

我正在为我们的新 Web 应用程序选择 javascript 库。这个应用程序的用户界面不是很重,但有表单、报告、搜索、日历、选项卡,并且像大多数网络应用程序一样面向多个国家/地区。

我们是一个小团队。最关心的是代码的可维护性和可读性。

我们是Python程序员。在评估了许多其他 javascript 框架后,我们将范围缩小到 mootools 和 google-closure。我们喜欢 mootools 语法。我们没有花时间去学习。就像Python一样。另一方面,我们对谷歌关闭中的私人/公共感到困惑。

使用 mootools 很诱人,但是我很想听听您关于这些框架相对于其他框架的具体优势。

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 we 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无畏 2024-10-16 09:56:33

这不应该是公认的答案,但可能会有所帮助。我最近不得不做出类似的选择——但对我来说,它是在 YUI3 和 JQuery 之间。我的首要任务是敏捷性和模块化,这让我倾向于 YUI3。尽管有些事情让我每天都会思考我的选择:

  1. Eclipse 中的 Code Assist。我已经习惯了 Python,还没有让它与 YUI3 一起工作。它似乎适用于 MooTools,但我没有看到它适用于 Google Closure。
  2. 堆栈溢出支持。 JQuery 有超过 55000 个标记问题,MooTools 有超过 700 个标记问题,但 Google Closure 和 YUI3 标记有 <50 个问题(YUI 约有 600 个标记)。
  3. 与普通 JavaScript 的距离。 YUI3 似乎包装了几乎所有脱离普通 DOM/JavaScript 的东西。这需要一些时间来适应,我感觉它很好地使我免受许多跨浏览器、优化问题的影响,而我什至不想考虑这些问题。然而,它确实削弱了更多普通 JavaScript 教程和示例的价值。我不确定 MooTools 和 Google Closure 之间的权重如何。

(顺便说一句。总而言之,我仍然很喜欢 YUI3。)

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.)

风渺 2024-10-16 09:56:33

好吧,这就是 jQuery 和 MooTools 之间的全部争论。两者之间并没有真正的优势。从 google-closure 的 Hello World 代码来看,Mootools 似乎有更干净、更快的语法。您还必须查看支持。当然,google-closure 是由 Google 支持的,但是 Mootools 有更多可搜索的问题和答案以及插件,正如 @mjhm 所说。

为了代码的可维护性和可读性,我个人会选择 Mootools 而不是 google-closure。对我来说,Mootools 比 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);
}

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);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文