問題描述
我管理著一組程序員.我確實重視員工的意見,但最近我們對于在 Web 項目中使用哪個框架存在分歧.
I manage a group of programmers. I do value my employees opinion but lately we've been divided as to which framework to use on web projects.
我個人喜歡 MooTools,但我的一些團隊似乎想遷移到jQuery 因為它被更廣泛地采用.這本身不足以讓我允許遷移.
I personally favor MooTools, but some of my team seems to want to migrate to jQuery because it is more widely adopted. That by itself is not enough for me to allow a migration.
我同時使用了 jQuery 和 MooTools.這篇特別的文章傾向于反映我對這兩個框架的看法.jQuery 非常適合 DOM 操作,但似乎僅限于幫助您做到這一點.
I have used both jQuery and MooTools. This particular essay tends to reflect how I feel about both frameworks. jQuery is great for DOM Manipulation, but seem to be limited to helping you do that.
功能方面,jQuery 和 MooTools 可以輕松實現 DOM 選擇和操作:
// jQuery
$('#someContainer div[class~=dialog]')
.css('border', '2px solid red')
.addClass('critical');
// MooTools
$('#someContainer div[class~=dialog]')
.setStyle('border', '2px solid red')
.addClass('critical');
jQuery 和 MooTools 允許輕松實現 AJAX:
// jQuery
$('#someContainer div[class~=dialog]')
.load('/DialogContent.html');
// MooTools (Using shorthand notation, you can also use Request.HTML)
$('#someContainer div[class~=dialog]')
.load('/DialogContent.html');
jQuery 和 MooTools 可以輕松實現 DOM 動畫:
// jQuery
$('#someContainer div[class~=dialog]')
.animate({opacity: 1}, 500);
// MooTools (Using shorthand notation, you can also use Fx.Tween).
$('#someContainer div[class~=dialog]')
.set('tween', {duration: 500})
.tween('opacity', 1);
jQuery 提供以下附加功能:
jQuery offers the following extras:
- 龐大的支持者社區
- 插件庫
- 與微軟的 ASP.NET 和 VisualStudio 集成
- 由 Microsoft、Google 和其他公司使用
MooTools 提供以下附加功能:
MooTools offers the following extras:
- 帶有經典 OOP 模擬的面向對象的 JS 框架
- 擴展原生對象
- 本機功能支持的瀏覽器之間具有更高的一致性.
- 更輕松的代碼重用
- 被萬維網聯盟、Palm 等使用.
鑒于此,MooTools 似乎無所不能jQuery 做了很多事情(有些事情我在 jQuery 我可以在 MooTools) 但 jQuery 的學習曲線較小.
Given that, it seems that MooTools does everything jQuery does and more (some things I cannot do in jQuery and I can in MooTools) but jQuery has a smaller learning curve.
所以問題是,為什么您或您的團隊選擇 jQuery 而不是另一個 JavaScript框架?
So the question is, why did you or your team choose jQuery over another JavaScript framework?
注意:雖然我知道并承認 jQuery 是一個很棒的框架,還有其他選擇,我正在嘗試決定為什么 jQuery 應該是我們的選擇,而不是我們現在使用的 (MooTools)?p>
Note: While I know and admit jQuery is a great framework, there are other options around and I'm trying to take a decision as to why jQuery should be our choice versus what we use right now (MooTools)?
推薦答案
這是一個奇怪的問題...我的印象是...
That's an odd question... I get the impression that...
- 您非常熟悉 mootools 并充分利用其 OOP 模型,從而使您的代碼更易于管理和支持.
- 您意識到 jQuery 的目的有些不同,并且針對 DOM 操作和 AJAX 進行了調整,并且 mootools 確實可以完成 jQuery 所做的所有事情以及其他一些事情.
- 聽起來好像您不需要以 3-rd 方插件的方式使用太多,這使得 jQuery 的受歡迎程度和支持變得不那么重要了.
底線,是炒作嗎?jQuery 正在變成像AJAX"、.NET 和 Web 2.0 這樣的神奇營銷流行語之一——這對他們來說非常棒,但是為什么 你 需要證明繼續使用對你如此有效的框架是合理的?還有一些我認為會涉及到的商業考慮:
Bottom line, is it the hype? jQuery is turning into one of these magical marketing buzzwords like 'AJAX', .NET and Web 2.0 — which is great for them but why do you need to justify staying with the framework that works so well for you? There's also the business considerations which I imagine will cover things like:
- 框架的壽命,或者 mootools 可能會在不斷增長的 jQuery 面前消失 - 非常值得懷疑,因為他們剛剛發布了 1.3 beta 1 并且有 2.0 正在準備在今年年底發布.
- 員工成本和他們的培訓(我想找到 mootools 程序員會比那些在簡歷/簡歷上打 jquery 的人更難).
- 在給定資源的情況下,在每個框架下維護和擴展系統所花費的時間(和成本).
這兩個框架都很棒,但我相信你的興趣最好還是留在 mootools 上.
Both frameworks are great but I believe your interests are best served in staying with mootools.
這篇關于與其他 Javascript 框架相比,為什么 jQuery 被如此廣泛地采用?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!