- February 27, 2014
You Might Need jQuery
With this level of saturation, it was only a matter of time before the backlash set in. You Might Not Need jQuery has become popular lately on Twitter, Hacker News, and even A List Apart. There have been many responses to this website defending the use of jQuery, some of them droll and some more in-depth.
Though we developers often strive to craft as much of our own code as possible, we also know when not to reinvent the wheel—regardless of how far modern browsers have advanced. jQuery provides a lot of tools we can use in our projects time and time again without worrying about fallbacks, workarounds, browser support, or inconsistent native APIs. TJ VanToll best sums up jQuery’s usefulness by listing 10 developer tasks jQuery’s API makes easier:
A pathway to programming
A common tool eases collaboration
Just like any other front-end framework, when and if you use jQuery, you should understand how it enhances your process and your final product. Performance considerations are a must. Critics of jQuery often mention the extra bytes downloaded by including jQuery in your site. There are many techniques to optimize file size in the age of bloated 1MB+ websites, but removing jQuery from your toolkit would save less than 2% of page weight. If page weight is still a concern, you can build a custom jQuery library for use in your projects to reduce the file size served to your users.
With all that in mind, I’m not against ditching jQuery in a project that suits the bill. If you’re using jQuery to do something you can easily accomplish with another tool, like vanilla JS or especially CSS, then looking into alternatives will level-up your front-end game in general. If you’re building websites using progressive enhancement, your users will still be getting the content and features they need with or without jQuery. But if you’re using a variety of jQuery methods on a website with the knowledge of what each feature adds to your final product, carry on.
In full transparency, Catherine recently spoke at jQuery Conference in San Diego, where she also received a free copy of the jQuery library.