jQuery used to be essential - now it's optional, or is it? The devs at GOV.UK have made a big fuss about finally getting rid of the evil code. But is dropping 32k of download worth it when you take everything into account?
I am a jQuery fan and have been for a long time, but I don't always use it when starting a new project. At the moment at least, I certainly don't think its worth re-engineering something to remove it from a working system.
Strangely there is a lot of prejudice about using jQuery because it has a long history. It is often said to be a "grey beard" choice, suggesting that old programmers just don't update their knowledge. Personally I think the situation is around the other way - younger programmers think they know what problem jQuery is supposed to solve when in fact they don't.
Let's take the GOV.UK programmer's reasons for getting rid of jQuery:
So the motivation seemed to be getting rid of 32KB of unneeded download and increasing the speed of execution. These are hardly grounds for getting rid of jQuery. The data presented indicate that there are some speedups as a result of removing jQuery. The argument is that jQuery was invented to makeup for the lack of support for CSS selector syntax and, as modern browsers all support this, we no longer need jQuery - it can all be done in plain JavaScript.
This isn't quite true as jQuery has long been about ironing out the differences between browsers and providing a powerful toolkit of functions that get the job done more simply. If you know jQuery then you can often find a natural implementation in fluent style that finds DOM objects, filters and changes them in one operation. It results in cleaner code and usually better code. Put simply, you don't just use jQuery to make up for browser deficiencies but for programmer deficiencies as well.
To remove jQuery just because querySelector and querySelectorAll are now supported just indicates that you haven't explored what jQuery actually gives you. It used to be called the standard library for JavaScript and it still has ways of working that are superior than just plain JS. If you are only using jQuery to do the work of CSS selects then you are guilty of not understanding what it offers. Keep in mind that jQuery's motto is "write less, do more" and it is still true.
Then there is the argument that GOV.UK's clients are not all going to be using top end machines and downloading 32K is a time waste if they are on a flaky slow connection. Really? This consideration doesn't stop the download of 50K of Google Analytics script or 60K in fonts! This really does seem like picking on a feature to remove just because it has fallen out of fashion. If the clients really are going to be connecting using old tech then communication speed isn't the only issue - old browser support is likely to be important. By removing jQuery and relying on what modern browsers provide native then GOV.UK has effectively disenfranchised the poor users they claim to be helping.
I'd like to see some metrics on how many clients are now having problems working with their web pages, not just a few figures showing me the obvious fact that dropping 32K of download means pages load a bit faster. But my guess is there are no such metrics.
Ah... it's all fashion and no logic.
jquery3
- Ian Elliot is the author of Just jQuery: The Core UI ;Just jQuery: Events, Async & AJAX; Just JavaScript: An Idiomatic Approach ; JavaScript Async and JavaScript Bitmap Graphics with Canvas. All these titles are part of theI Programmer Librarypublished by I/O Press .
More Information
Related Articles
jQuery 3.2.1 Is Out - Do We Still Care?
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
What Does JetBrains Survey Tell Us About AI
29/10/2025
The results of the 2025 JetBrains Developer Survey are out and indicate just how deeply AI tools have become embedded into software development. However, while 85% use AI tools for coding and de [ ... ]
Linkerd Adds MCP Support
06/11/2025
Buoyant, the creators of the Linkerd open source and service mesh for the enterprise, have announced the addition of support for Model Context Protocol (MCP) in Linkerd to extend its core service mesh [ ... ]
- .NET 10, C# 14 and F# 10 Released Alongside Visual Studio 2026
- Google AI Studio Does Angular
- Jules Coding Agent Upgraded
- IBM Launches Granite Version 4.0 and Granite-Docling
- Julia 1.12 Adds Trim Feature
- The Fuss About Fil-C...
- Europe Gets Its Own LLM
- Robot Army Video As Robots Shipped En Masse
- Windows XP Crocs Now On Sale
- W3C Adopts A New Logo
- Chrome DevTools To Benefit From MCP
- Mico - A Personality For Copilot
- GitHub Copilot CLI And Spaces In Preview
Comments
or email your comment to: comments@i-programmer.info
<ASIN:1871962501>
<ASIN:1871962528>
<ASIN:1871962579>
<ASIN:1871962625>