public
Last active

In Response to BadassJS "Why Do You Hate jQuery?"

  • Download Gist
why-i-dislike-jquery
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<div style="white-space: normal">
Twitter anonymous user posted the question to me "Why do you hate jQuery?" The question implies that I have hatred of jQuery. I've been over the problems with jQuery over and over again. So much that I have long ago grown tired of it. I'll just sum them up here, with no code review. For links of jQUery code reviews, see "JavaScript Query Engines" article, on the site dhtmlkitchen.com (site was transferred to a new owner who had agreed to maintain it but instead dumped it).
 
Why do I dislike jQuery?
 
The initial design looked like a creative web programming experiment (and experimenting is a great way to learn, for sure).
 
But jQuery was touted as something of a general purpose solution to web scripting. Web authors having a very superficial and limited understanding of what they do, could now do things that they would have otherwise been incapable of. It was empowering to this class of developer.
 
However, for web developers who actually understand what they are doing, jQuery demoted our role from someone who employs a a broad spectrum of conceptual and problem-solving skills. With jQuery, knowledge of web standards, web browsers, OOD, and EcmaScript help as far as understanding what jQuery does. However, once that is understood well enough, it quickly becomes clear that jQuery isn't the best application of those technologies.
 
jQuery has many inextricable design problems. Fixing them will cause change propagation and upgrade problems. jQuery has had problems with recent IE browser releases, requiring users to upgrade and retest.
 
The overloading and typechecking adds needless internal complexity. The code is unreadable, hard to debug, and results in errors.
 
By confusing attributes and properties, jQuery has caused a lot of bugs.
 
About the author
jQuery was critically reviewed around 2007. The author (John Resig) participated in that thread, left the group, and kept his mistakes.
 
John later issued a "collective ban" of comp.lang.javascript. Resig adopted some of the 2007 criticism with browser sniffing soonish, but hesitated to update the problems with attr until 2011. but didn't to give credit to the people who found the problems (David Mark, Richard Cornford, and myself included). Even in GitHub code commits, I've submitted perfectly plain-language comments, no personal negs, yet they have been met with hostility and even deleted, yet resulted in fixes.
</div style="white-space: normal">

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.