|GOV.UK Drops jQuery
|Written by Ian Elliot
|Wednesday, 25 May 2022
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:
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.
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.
or email your comment to: email@example.com
|Last Updated ( Monday, 20 June 2022 )