4 ms·
jQuery as commonly used leads, in my personal experience, to hard-to-maintain programs. Just like Ruby on Rails, or Perl. There is also anecdotal evidence that
by aristus 16y ago
jQuery as commonly used leads, in my personal experience, to hard-to-maintain programs. Just like Ruby on Rails, or Perl.
There is also anecdotal evidence that jQuery qua jQuery has some fundamental limits. I worked on a largish jQuery application, written by ninja badasses, and it creaked a lot more than it should have for its size.
Comparable systems built on YUI seemed to have more structure. I actually went through the exercise of converting a prototype from jQuery to YUI3, and spent a lot of time working out their respective "philosophies". (see http://jsrosettastone.com http://jsrosettastone.com)
There are newer frameworks (eg JavelinJS) that aim to be to jQuery what jQuery was to other frameworks.
- smokeyj 16y ago> jQuery as commonly used leads, in my personal experience, to hard-to-maintain programs. People using jQuery improperly is not something wrong with jQuery. jQuery is perfectly fine for large web applications, you just need to organize your code properly, with something like a MVC and ORM layer.
- aristus 16y agoOne can always argue "you're doing it wrong". People say the same about ror and perl. But in my experience, even with a good mvc and object model, and world-class folks, complex applications in jquery tend to become hard to maintain. I believe part of the reason is the tight coupling of state and events to the DOM. I'm also very skeptical of the dozen-odd undocumented "extensions" to the selector language. They are useful, but tend to tie you to jQueryisms. I didn't realize for a long time that :first was not valid CSS3.
- shadowpwner 16y ago:first-of-type is valid CSS3, though.
- xtian 16y agoAnd :first-child is valid CSS2.1.
- catshirt 16y agoit's documented here http://api.jquery.com/first-selector/ http://api.jquery.com/first-selector/
- aristus 16y agoUndocumented as in "we included it in our 'CSS3-compliant selector engine' but do not mention anywhere that it is not actually part of the CSS3 spec, just something we thought was cool".
- freakwit 16y agohttp://api.jquery.com/category/selectors/ http://api.jquery.com/category/selectors/ "Borrowing from CSS 1–3, and then adding its own, jQuery offers a powerful set of tools for matching a set of elements in a document."
- aristus 16y agoYes, you've found the five-word phase that mentions that there are extensions in the selector engine. There is no documentation on which things are, or are, not, extensions. Now that we've gone all the way down the pedantry slide, have you anything of value to contribute, or was that it?
- freakwit 16y agoYou're being disingenuous here. Anybody looking for information about jQuery's selectors will google "jquery selectors" and find that five-word phrase front and center. Or take a look at the jQuery front page and hover over "CSS3 Compliant" to see "Supports CSS 1-3 selectors and more!". If you want to pick on something that claims compatibility, try Sizzle itself - http://sizzlejs.com/ http://sizzlejs.com/. In that case, you'll find a summary of alterations right at the top of its documentation https://github.com/jquery/sizzle/wiki https://github.com/jquery/sizzle/wiki .
- bad_user 16y agoI worked on a largish jQuery application, written by ninja badasses I don't think those "ninja badasses" were as good as you're describing them. If they were, they would realize that jQuery is not a framework that structures your application, but just a neat and light library that provides syntactic sugar for DOM-manipulation + dealing with cross-browser issues. jQuery as commonly used leads, in my personal experience, to hard-to-maintain programs. Just like Ruby on Rails, or Perl. Well, I could say the same thing about Java/C# or PHP ... in fact, the shit I had to put up with in those (more structured) platforms is far worse than anything I have seen thus far that was done on top of jQuery / Rails and Perl. And I thought Python/Django had immunity from such problems, until a month ago. Newsflash: bad developers write bad code. And yes, I've worked with Perl -- Catalyst and DBIx::Class are pretty good, you should check them out ;-)
- aristus 16y agoWell, you may have a different experience. I've also noticed a new trend in complex applications, eg JavelinJS and Yahoo's "Minty" mail app, that moves away from jQuery's or YUI's model. They feature a centralized controller/arbiter and a separation of CSS classes and event markup. Instead of jQuery + MVC it's a little of both. See also http://news.ycombinator.com/item?id=2430271 http://news.ycombinator.com/item?id=2430271