TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Poll: Suggestions please, which JavaScript library?

37 pointsby kashifalmost 17 years ago
I am beginning two projects which require a lot of JavaScript work - specifically DOM manipulation and animation. Suggestions please...<p>Which one do you like and why?

26 comments

IsaacSchlueteralmost 17 years ago
It really depends on whether you like Javascript or not, and whether or not your new library-based code has to play nicely with non-library javascript.<p>jQuery is an interesting language. But I feel like it's no more "javascript" than C is assembly. It uses a lot of conventions and syntactic sugar that is not standard in the language. It's a cool and elegant, but there's a learning curve at both ends; first, you need to learn it, and then it becomes so habitual that you forget how to write "regular" javascript.<p>YUI, on the other hand, feels a bit more like plain old JS, which some people like and some people don't. The main problem with YUI is a lack of overall consistency in naming and whatnot. YUI 3 is coming out soon-ish, and addresses a lot of that stuff quite nicely. YUI does a really good job of not cluttering up your environment with too much gargbage--everything is under one global YAHOO object, so it's a friendly neighbor.<p>Avoid prototype at all costs. It monkeys around with the core object types, and adds scores of globals, which pretty much ensures that, unless ALL of your code uses prototype, and always will, you'll get unexpected behavior in some cases.<p>YUI was built first and foremost for use at Yahoo. It'd be hard to find a library that's more play-tested or scrutinized for performance than that. Personally, I find the core YUI libs a lot more useful than the widgets. They tend to be a bit over generalized in a lot of cases, and I can usually get better results by rolling my own.<p>Disclaimer: I'm a webdev at Yahoo, and I've been using YUI since its pre-OSS days.
评论 #211851 未加载
评论 #212084 未加载
评论 #211864 未加载
评论 #212030 未加载
评论 #211845 未加载
anonymalmost 17 years ago
I use Dean Edwards's base2. I like it because it is very simple, and because it adheres to standards; that is, rather than creating a map and a forEach of its own, with its own semantics, it implements them according to the Javascript standard (or proposals, don't recall if they have yet been adopted) for browsers that don't yet support them natively (anything but Mozilla, I think). It also cleans up DOM manipulation so that you can use standards-compliant methods and it will work on non-compliant browsers (all the way back to IE5).<p>Similarly, for DOM querying, it implements the W3 Selectors API rather than reinventing the wheel.<p>I really like this approach. base2 doesn't provide anything in the way of widgets (though I think there may be some code along these lines in the Subversion repository, implementing some of the HTML5 components) -- for most of what I do, widgets aren't available anyway or would need to be extended, so I end up writing my own. And it's easy enough to use a YUI or other widget with base2 when it makes more sense.<p>For animation, I've used animation.js and found it simple and fast.
评论 #211896 未加载
bomberstudiosalmost 17 years ago
jQuery is fast, lightweight and easy to master.<p>For more advanced stuff, your best bet is Prototype.<p>Dojo, YUI (and ExtJS, not on your list) are good if you have a massive team of JavaScript developers and need standards and solid documentation, but are overkill for 90% of projects.
评论 #211648 未加载
评论 #211802 未加载
Harkinsalmost 17 years ago
My vote's on jQuery, but whatever you do, do it unobtrusively (one reference: <a href="http://simonwillison.net/static/2008/xtech/" rel="nofollow">http://simonwillison.net/static/2008/xtech/</a> ).<p>It's easy if you do it from the start, and there's a real savings in maintenance costs.
scooter53080almost 17 years ago
I started my current project in ExtJS and a few weeks in, I switched to YUI. The ExtJS components look great, and are fairly easy to use if you use them in the standard way. However, I found that as soon as I wanted to do something custom I got totally lost in the 'ExtJS' way. While the YUI components are not quite as polished looking, I have a much easier time extending/reworking them. One thing I like about both frameworks is they provide layout management, so it is very easy to have a 100%width/height viewport layout that the framework manages (YUI's LayoutManager is in beta...so I guess I hope they don't scrap it before it reaches production level.)<p>I will add that the ExtJS forums are very active and pretty helpful...as are the YUI ones. I've asked several questions in both and gotten good responses each time.
hbienalmost 17 years ago
I really like jQuery because it's lightweight but I think it really fits your needs perfectly. For DOM manipulation in jQuery you just use CSS selectors, so... :<p><pre><code> $('a.hide_these').hide(); </code></pre> Would hide all anchors with class 'hide_these'. You don't have to do any iterations or pass any anonymous functions. Traversing works the same way too:<p><pre><code> $('a.hide_these').parents('p') </code></pre> Would find all the paragraph tags that are parents to those anchors.<p>I've only used a few animations from jQuery (like sliding/fading) but the framework also lets you do your own custom animations using CSS (your element will gradually morph to the styles you define).
评论 #214586 未加载
agottereralmost 17 years ago
Prototype is terrific. The problem is most developers dont utilize 90% of the functionality. Thus making it a bloated library. Read through the documentation frequently. You will pick up on nice new functions that will make life so much easier. Go with JQuery if you are looking for basic use prototype if you want the extra goodies.
SwellJoealmost 17 years ago
ExtJS is the one we actually use in our products...the widgets are just too awesome to skip. I'm not entirely on-board with the way things work. It's a very OO style project, and feels kinda like working with Swing or some other Java toolkit. A bit verbose at times. But, the library has so much coverage, it'd take us an extra six months to a year to develop those bits and pieces using jQuery, which I find more fun and natural to use.<p>YUI is a close runner up, and if I were starting today I might go with it. The widgets are fantastic, the documentation is fantastic, and the community is large. It also feels more like JavaScript than ExtJS.<p>As jQuery UI develops it'll probably become a contender in that space, as well. But, for now, I'm just adding it to our websites in a few places where it is useful--that's the other negative about ExtJS: It's a "drink the Kool-aid" kind of library. I've had a hard time integrating it in little bits and pieces, and it's turned out that everything is going to have to be converted to use ExtJS for it to all work together.
bprateralmost 17 years ago
Few libraries make me curl my toes in pleasure like jQuery does. I'm absolutely enamored with it!
tgdaviesalmost 17 years ago
<i>If</i> your back end is Java, use GWT -- that gives you statically typed RPC calls between your client and server, which makes life easy.
评论 #211806 未加载
luxalmost 17 years ago
jQuery has been a huge time saver for me, highly recommended. I did look at pretty much all of these before settling on it, and haven't regretted it at all. jQuery is amazingly easy to get started with, very concise, but also amazingly expressive and flexible without sacrificing readability or conciseness.
评论 #211685 未加载
enkialmost 17 years ago
Objective J + Cappucino
JFredalmost 17 years ago
Very few of us have extensive experience in more than one library. JavaScript muddled along without standard libraries for a long time.<p>I use Ruby on Rails, which has support for Prototype/Scriptaculous, so that's what I use. I like it a lot better than straight JavaScript. The thing that the libraries do well at is papering over browser differences. One good aspect is they collect "fixes" and tricks that have been spread all over the web and concentrate them one place.<p>I'm mystified why Prototype doesn't download in minified format. It's easy and useful to do but I'm sure most folks don't think of it.
3KWAalmost 17 years ago
I've played with MochiKit and jQuery. Like them both but have been doing more stuff with jQuery lately ... can't comment on the others :P Checked them out quickly and none appealed to me :P
axodalmost 17 years ago
There is of course the other option of not using any of them and programming custom things in javascript. I'm not sure if this takes longer or not - I haven't used any of the above libraries - but I think you get a more satisfactory result.<p>DOM manipulation is pretty simple with the javascript dom functions, as is animation, although it depends on how custom you need it, and how much you're worried about speed/bloat/etc
评论 #211807 未加载
评论 #211725 未加载
评论 #211787 未加载
alexkalmost 17 years ago
Prototype gives you power to develop custom interfaces and supports various idioms - events, cross-platform layout, positioning, classes, not just fancy widgets, use Prototype when you need total control over your interface.
thomasflalmost 17 years ago
I prefer jQuery. It's the fastest growing javascript library. It's the newest javascript library on the list. It runs fast, and most importantly; it has a very simple and readable syntax.
ashleywalmost 17 years ago
I've used JQuery once or twice, but I will definatly look into it more, been hearing good things about it, and this poll just backs it all up.<p>But using a lot of Prototype in the past....
tbearalmost 17 years ago
We love Ext JS.. We've been using it for about 3 months. Its awesome. Nothing else like it in quality, elegance, and end product.
justinbmeyeralmost 17 years ago
How about JavaScriptMVC along with one of these frameworks. It will really help you organize and maintain your project.
justinbmeyeralmost 17 years ago
JavaScriptMVC also uses event delegation, which can really help performance and code organization.
dualogyalmost 17 years ago
Not having used any so far, I have to say from the demos I'm most impressed with Dojo and extJS.
chaostheoryalmost 17 years ago
i think the main reason people use prototype is that it has very strong integration with rails and symphony... if it weren't for that; I probably would have switched to jquery a long time ago
jaxnalmost 17 years ago
I also like ExtJS. You can use ExtJS in conjunction with YUI as well.
jfornearalmost 17 years ago
Mootools is easy to use, and I'm a noob.
评论 #211833 未加载
pmoricialmost 17 years ago
Google Web ToolKit