Why do many web developers hate jQuery?

22nd Nov '163 of your Earth minutes

Why do many web developers hate jQuery?

The following is an answer I originally posted to the above question posed over on Hashnode, the developer community. Thought it was worth sharing :)

When jQuery was the new thing, people loved it. It made cross-browser JS so much easier, it taught us a few new tricks, it made AJAX and animations dead simple (which was pretty tricky back when most of the world were on IE6!)

It evolved a not-to-be-sniffed at plugin community and immense mind-share. It became the de facto client-side Javascript library for years.

Those were the heady days of jQuery’s heyday and it gained a lot of weight as it spent its popularity on better support and more features.

Also it attracted a lot of mediocre developers because it was seemingly ‘easy to use’. This resulted in a lot of terrible Javascript being written and much debate between so-called pros (although there’s nothing professional about berating newcomers) about the merits of using a library which they saw as being the lightning rod for all this bad code.

Then came The Smartphone Times. This spelled disaster for jQuery: thanks to slower, inferior CPUs, less memory and often less bandwidth, smartphones just weren’t cut out for lugging around all the goodness that jQuery provided — especially if you were only using 10% of it.

This meant that a deep analysis of jQuery’s internal elements went underway to see how things could be more modularised. And as we headed into the Golden Age of web development, many realised that the browsers have started to agree on some of the crap that jQuery The Negotiator had been helping them with all along. So they actively and rapidly trimmed the fat.

During this modularisation stage, many factions split off from jQuery to create super-tuned, single-purpose libraries that were extremely lightweight. They could still work everywhere (mostly) and they didn’t eat up people’s 3G/4G data allowances. They also performed better than jQuery in the browser in some cases.

Also in the background, the Javascript Revolution was happening seeing this ‘little browser language’ become a full-blown, server-side programming language. And this highlighted that jQuery was very much a client-side, DOM manipulation library, skills which weren’t so transferrable to the server-side application style of programming.

Besides all of this, jQuery gained some younger, better-looking cousins/distant relatives (Angular, React etc) which tackled similar problems to jQuery in altogether new and intuitive ways. And on top of that, these new relatives started pushing to use the latest Javascript APIs, seeing super increases in performance thanks to newer browser support, while jQuery hung back making sure its feature-set worked in as many browsers as it could consistently for as long as possible.

But don’t write jQuery off just yet. It will be 10 years old next year. In internet years that’s approx. 1,000 years old. But look, jQuery is still going strong. Sure it’s not as slick and fast as some of its younger cousins, but it still got some moves they don’t do. And for those of us who remember why jQuery was the shiznit, we still got some deep respect for it and may still use it for convenience.

jQuery made a mark on client-side Javascript like no other and ushered in the Golden Age. But sometimes you gotta walk over the bones of the dead to get to the future…

#notadesigner • #sometimesitworks

All content licensed CC BY-SA 4.0  •  Code highlighting by Torchlight