Code n00b: Fight for Your Right to jQuery
Ouch, jeez, I didn’t mean literally. Put down yer dukes and listen up, because here’s my reasoning: jQuery helped build the web we all know, love, and use 24/7 every day. It helped solve little issues like, oh, browser compatibility and those nice smooth transition effects devs loved long before CSS was advanced enough to handle the job. But the number one reason you — yes, you! — should have at least a glancing knowledge thereof? The fact that jQuery is just about everywhere. Yes, still.
Still unconvinced? Here are some numbers according to the HTTP Archive, which crawls the top 10,000 websites from the Alexa top sites on the internet (we free users can only see the top 500 Alexa sites for free). The archive then exposes all that data as a downloadable MySql database containing all kinds of interesting metrics, including libraries required by those websites.
In 2017, jQuery showed up in 80 percent of these. Four out of five of the top 10,000 websites all use jQuery! You may argue that this is because WordPress powers so much of the consumer internet these days, and that WordPress uses jQuery… so we non-Wordpress devs can just safely ignore it (as can, come to think of it, anyone unlucky or simply lazy enough to develop projects atop WP, but I digress). Then, however, you will need to explain to me why Bootstrap only shows up in 14 percent of those same crawled sites when Bootstrap and WordPress go together like snot and Kleenexes. So that’s not the reason for jQ’s internet omnipresence.
I’m not saying it’s the silver bullet or anything. jQuery is great for simple or reasonably contained projects. Large-scale apps with lots of contributors, though, you definitely want a more rigid framework like Vue or Ember — lest the freestylin’ world of jQuery leads you to build a Flying Spaghetti Monster of tangled and unmaintainable code.
- jQuery is fully open source and actively maintained
- One of the biggest slams against jQuery is that it adds unnecessary file size to your site. And while it does add a load, the truth is this is more often than not insignificant. Even if it is not…
- …A huge percentage of your visitors already have jQuery cached from a CDN. This means using jQuery is essentially free as far as your bandwidth is concerned. It won’t slow down the loading time of your website in any meaningful way.
- Even if they don’t have it cached, jQuery Slim Minified + Gzipped is only about 27KB. Your HTML markup alone might be larger than this! If you want the full-featured version of jQuery, that’s only about 6KB more.
- Most of all, developing in jQuery — instead of some more opinionated framework — can be genuinely creative and fun. Freestylin’, even.
So! Not only is jQuery still relevant, it’s embedded in today’s web-like spat-out Skittles in basement rec room shag carpeting. And there’s a 100 percent chance you are going to come across it at some point. The smart thing to do would be to stop spreading knee-jerk jQuery hate… and maybe even put it to good use yourself.