6 ms·
Can anyone explain when did jQuery start to fall back in the tech era? What were its failures? It is a bit sad to say goodbye to such an old friend.
by aamederen 10y ago
Can anyone explain when did jQuery start to fall back in the tech era? What were its failures? It is a bit sad to say goodbye to such an old friend.
- nikanj 10y agoIt just works, and that makes it old and boring. I'm only 40% joking.
- untog 10y agoI don't think there are any failures in it - it could have grown outwards to become what React is today, or something, but it always kept to the principle of doing one thing and doing it well: unifying browser APIs across vendors and simplifying them. (yes, I realise that's two things, but...) These days there are many fewer differences between vendors, and things like the Fetch API are making the kind of simplifications jQuery pioneered a core part of the browser experience.
- jdavis703 10y agojQuery to me was always meant as a DOM manipulation library. It didn't fall behind per se, it's just that browsers became good enough and standard enough that you no longer needed this type of tool. I think it would have been a huge mistake for jQUery to have attempted to become a Backbone, Angular or React, because it really was never meant for building web apps (of course you could still use jQuery in Backbone and Angular, and in fact those projects kind of assumed you were using it, or at least something that was API compatible).
- ofcapl_ 10y agoyup, I've also always used jQuery for ajax requests - a lot simpler/quicker/less-line-er for development than defining plain xhr requests
- aindhaden 10y ago> it would have been a huge mistake for jQUery to have attempted to become a Backbone, Angular or React What would you call jQuery UI?
- jdavis703 10y agojQuery UI was a set of UI components, not an application framework that attempted to handle state and UI views in a coordinated fashion.
- 3131s 10y agoI can't answer that, but I'll say that I still include it in most projects without a second thought. Maybe I'm not aware of some existing superior replacement, but since I don't care much for the popular modern JS frameworks JQuery + vanilla JS is still my goto choice. Following good coding principles, I haven't yet had any project grow to be too messy, but maybe I'm just not working on extremely complex front-ends.
- pault 10y agoIt didn't have any failures, the browser APIs have just finally caught up with it. I would guess that 99% of jQuery usage was for ajax, event normalization, and CSS selector queries, which are now trivial and cross platform in vanilla JS (with a little help from the fetch polyfill for ajax). I personally haven't used jQuery in a project for at least two years, and I doubt I'm in the minority of front end developers in that regard.
- sjwright 10y agoJquery did two things well: it provided a terse, sane syntax for many common tasks, and it provided robust cross browser support. Modern browsers have partially solved both these issues. (The former with .querySelector() and the latter with the deprecation of MSIE 6/7/8.)
- donw 10y agoAlthough the comparison isn't perfect, you can think of jQuery as PHP in the late 90s and early 00s. PHP made web development accessible to the masses. Because PHP is embedded in the HTML itself, it is way easier to work with than Perl or Java, especially in the context of The Web In 1999. In the same vein, jQuery filled a very important niche when the web was just getting started. It made Javascript accessible, by smoothing out the differences between browsers, and by providing a useful set of abstractions over the mountain of quirks that is client-side Javascript. Most importantly, jQuery made hard things that people wanted to do stupidly simple. But in 2016, there are fewer differences between browsers, and more importantly, our knowledge of How To Build Software has massively improved through lots of trial, error, and iteration. And things that used to be really hard in Javascript are now a lot easier, thanks to improvements in browsers, languages, and tooling... well, the tooling still needs work, but that's a different discussion. The world that jQuery served no longer exists, and it has largely been replaced by more effective abstractions. It will never truly go away, but neither will it be the choice for most people that are looking to create something new.
- dispose13432 10y ago>PHP made web development accessible to the masses. Because PHP is embedded in the HTML itself, it is way easier to work with than Perl or Java, especially in the context of The Web In 1999. PHP didn't make it easy. It made it possible. Until fairly recently, getting a VPS was insanely expensive, so any learner, hobby, startup went to shared hosting. As a result, any tech which required starting servers or elevated permissions was out, so Java and ISAPI (remember that?) were out. So the only choice was PHP/ASP or perl/C/tcl cgi scripts. cgi scripts had to be located in the /cgi-bin directory, so they looked ugly in the URL and simply wasn't designed for the web (so no url_parsing libraries (but no register_globals!)) and no git/github/blogs/stackoverflow whee to just go and download them. So one had a choice between PHP and ASP. ASP costed quite a bit more for the license, so PHP took over the internet.
- kalleboo 10y agoCGI scripts were also a lot harder to secure on shared hosting. I remember the hosts supporting them required security review before being installation. Then PHP came along with safe_mode and open_basedir, and if there were commonly-deployed solutions for CGI after that, I sure didn't see them because everyone was already using PHP.
- wfleming 10y agoNikanj isn't wrong (and is funny), but I think the other (more justifiable) reason is that jQuery largely isn't necessary anymore: when it came out, there were an uncountable number of browser incompatibilities that needed painting over, and APIs for remote requests, DOM querying & manipulation and the like were very immature, so a library to make everything usable was extremely valuable. Now, those APIs are mature & standardized & it's generally not too hard to write vanilla JS that works across all the major browsers. I don't think jQuery has failed, but for the kind of baked-in functionality Rails wants it's not really needed, and there are good reasons not to pack another dependency into your framework if it will increase page download size & is increasingly unlikely to be used by the framework's users.
- dom0 10y agoExactly. For my little JS needs I just use vanilla JS (even though the APIs are poor and the language is worse), since it will very likely work across all browsers I care about (recent FF/Chrome/Edge).
- mercer 10y agoI recall reading that element.querySelector(All) was inspired by jQuery. If true, it means jQuery was so much of a success that parts of it were implemented natively in browsers! (I couldn't confirm this by googling, so if anyone can confirm or deny that this is the case I'd love to know!)
- gsnedders 10y agoTo some degree, it's absolutely the case that JS frameworks of the era have shaped what browsers have done in the late-00s. I can't remember the detail of document.querySelectorAll; it was first proposed around the time jQuery was originally released. element.querySelector I think was largely inspired by jQuery's usage of it (in part to make it easier to run more of jQuery's selectors natively!).
- fusiongyro 10y agojQuery is for adding behavior to web _pages_. It thrived in the era where most web development happened on the backend and frontend development was really about sprinkling interactivity and effects onto a page. jQuery does not supply powerful-enough abstractions for writing applications. Early attempts to layer MVC on top of jQuery did not meet with much success; Angular and other libraries used it initially for DOM manipulation but as time went on they mostly found ways to drop the dependency. I still think that if you're building _pages_ instead of an application, you should consider it. Plus, it is a great tool for understanding and manipulating the DOM. I think it will continue to be popular with casual web developers for a long time, although frontend engineers have probably not been using it for years. I think the death of jQuery is exaggerated, but only time will really tell.
- Eric_WVGG 10y agojQuery never fell back. It’s whole raison d'etre was to be a crutch. The rest of the industry stepped up.
- aphextron 10y ago> It is a bit sad to say goodbye to such an old friend. I see this as more of correcting a poor design decision on the part of Rails, rather than having anything to do with the relevance and usefulness of jQuery today.
- TheAceOfHearts 10y agoIf you're just targeting modern browsers, You Might Not Need jQuery [0]. jQuery was great when dealing with browser inconsistencies and when all you had to do was wire up a few things. If you're building a marketing website or a lightweight app, I think using jQuery is fine. But if you're building anything more sophisticated, like a highly interactive web app you'll probably skip on jQuery and just use React or something similar. I think context is very important. Are you building something that is being maintained by multiple engineers? Does it have to accommodate regularly changing requirements? You can go really far with server-side rendered Rails and a few bits of jQuery thrown into the mix. But once you're past that point, embracing the ecosystem becomes more useful. [0] http://youmightnotneedjquery.com/ http://youmightnotneedjquery.com/
- LostInTheWoods2 10y agojQuery isn't dead, and wasn't a failure. It is still widely used and probably will be for some time to come. There are many different types of web projects! For those that require more than vanilla js, and less than a full blown framework (Angular, etc.), jQuery still has its place.