
A love letter to jQuery - joshmanders
http://madebymike.com.au/writing/love-letter-to-jquery
======
AnkhMorporkian
I may have turned into a little wimp, but this actually made me a little misty
eyed.

Sometimes when I'm working with React or Ember on a large project, and have to
do quite a bit of work for a small feature, I fondly remember the days of just
banging out a two-liner with JQuery that would do the same thing.

~~~
namenotrequired
Stupid question from a newbie: why don't you do that today?

~~~
AnkhMorporkian
Well, while frameworks require a bit of boilerplate, it makes large projects
MUCH more maintainable. Back in the bad old days, yes, you could bang out a
bunch of features very quickly in JQuery, but as the size of the site
increased there were lots of opportunities for disparate sections of code to
interfere with each other. Additionally, there are serious performance
concerns using jquery for any significant number of DOM mutations, which most
of the major frameworks solve. Finally, you can't just arbitrarily mutate the
DOM in these frameworks, so you can't use jquery willy-nilly if you're using
them.

~~~
Can_Not
Some frameworks reduce boilerplate by implementing features for you in their
way so that tiny trivial tweaks require reverse engineering the framework and
maintaining your own fork of the framework. Hopefully generators that scaffold
boilerplate instead of hiding features in the framework stay to pick up more.

------
mortenjorck
Nice meditation on one of the defining frameworks of the modern web. I don't
see robust front-end frameworks like React as ever really making jQuery
redundant – for the non-app, document-paradigm web, these solutions make for
over-engineering, while pure JS still leaves (ever fewer, granted) gaps. For
certain purposes, jQuery will remain the best fit for some time to come.

------
_Marak_
Heh. I still use jQuery for pretty much every project.

There is a server-side port of jQuery which is absolutely fantastic:
[https://github.com/cheeriojs/cheerio](https://github.com/cheeriojs/cheerio)
This allows you to render jQuery based views on the server or client with the
same code.

All the latest JavaScript view libraries are a huge pain to work with. Sharp
learning curves, punishing APIs, and extremely unexpected performance issues.
jQuery just works.

<3 jQuery

------
brakmic
Whenever I hear "You don't need jQuery!" I immediately ask myself: is this
guy/girl younger than 25?

~~~
karlshea
I think even people that are older sometimes forget how terrible it was to
develop with JavaScript before things like Prototype and jQuery came on the
scene. Just moving from alert() to console.log() was a revelation.

~~~
brakmic
You're right!

Forgetting to say "thank you" to people who helped us a lot is something that
happens more than often in IT.

I still remember when I heard of jQuery. It was in 2007 and it was so amazing.

Yes, I admit, the 'alert()/console.log()' was amazing :)

~~~
karlshea
I'd just like to go back and show 15-year-ago me Firebug or Chrome/Firefox's
DevTools and inspector. It's pretty stunning how far the tooling has come and
what you can do with it.

~~~
antod
Heh, nearly that far back I was wishing I could install Venkman in IE.

JQuery and Firebug deserve a lot of credit for bringing some sanity to JS/web
development. Sure things have moved on now, but they were ground breaking.

~~~
aidos
Man, it was 2006 (10 years ago!) when Firebug, Drosera [1] and Web Inspector
[2] were all released. There were definitely a lot of people eager to have
some tools to make front end web dev easier back then.

I never worked with Venkman but I recall all too well the hellish time I had
debugging JS back around the turn of the millennium. IE was laughable, if
there was an error in a script somewhere it would often just say error on line
-1.

[1] [https://webkit.org/blog/61/introducing-
drosera/](https://webkit.org/blog/61/introducing-drosera/) [2]
[https://webkit.org/blog/41/introducing-the-web-
inspector/](https://webkit.org/blog/41/introducing-the-web-inspector/)

~~~
antod
That part about the line numbers in IE error messages was exactly the pain I
was thinking of :)

------
indubitably
A lot of what is now called Native comes from Javascript — every time we use
`querySelector(All)`, for instance, it’s because of jQuery’s influence. Which
makes me a bit less nostalgic than this author: every time I use qsa I think
“Thanks, jQuery”, but I don’t need to use jQuery itself anymore…

------
Kequc
I've always had a dissatisfied opinion about jQuery, I much preferred
Mootools. When coffeescript turned up, it seemed to hop on the back of jQuery.
Doing a lot of the things Mootools already did and leaving gaps where jQuery
was king.

Now I use typescript and no libraries at all. It isn't too difficult to write
a utility object that can handle whatever depreciations or abstractions are
fluctuating.

If you are writing a library of any kind and expect your clients to install
jQuery for the benefit I'd say you've added too much bloat.

~~~
emehrkay
Funny how ES6 looks a lot like MooTools, it was ahead of its time

------
esaym
I wish he would have said why he doesn't need it any more. Heck, I just paid
$30 to code school last summer to take the jquery courses and now I use the
heck out of it on everything...

~~~
mythz
The big front-end JavaScript frameworks like React and Angular are architected
in a way that no longer require jQuery for DOM querying or manipulation.

They also smooth out browser quirks which is less of an issue now with Modern
browsers than it was at the dawn of jQuery which was another USP it had that
propelled it to popularity.

~~~
esaym
Well I figured that. I was more interested in how he moved away from jquery.
I've looked into Angular many times over the years. But sadly, I find more
people complaining about it than praising it. Looking into React now.

------
neom
John Resig is one of the kindest, gentlest, most wonderful people I've ever
met. I think this is heavily reflected in jQuery itself. Thanks for everything
JR and jQ! <3

------
iamleppert
Honestly, I miss developing with jQuery. It was fun, expressive, fast, and
unopinionated.

I miss the web before the framework bro's came in and over-engineered the hell
out of it.

------
dre85
Wonderful letter. I agree wholeheartedly. I learned web development 15 years
ago and I stopped for a long time. When I came back about 3 years ago, jQuery
for me was such a beautiful and pleasant reintroduction. I kept thinking to
myself "I can't believe this! You mean I don't have to use those insanely long
and unintuitive native js Dom calls anymore?!"

------
err4nt
I'll just offer another perspective. for me jQuery was a major stumbling block
to me learning JavaScript. And without JavaScript, you can't write very much
jQuery either.

I'm young enough that there's a generation of jQuery-loving developers above
me, and the whole generation younger than me is enamoured with the newer
frameworks. But for me it wasn't until I stopped looking at jQuery and focused
on proper JavaScript that any of it made sense to me.

The thing I find remarkable the more I learn Js is that the 'level' of the
language seems _perfect_ for the problems you're working with. jQuery makes
things abstract and high-level enough you'll never figure it out - and any
lower level and JS would be a lot harder to learn. The more I get into it the
more perfectly suited to the task it seems to be.

------
bradgessler
The best APIs are those that don't change because they work so well. jQuery
has pretty much been that.

------
_greim_
Here's an alternate POV. jQuery is fading from the spotlight not just because
there are better ways of handling the DOM, but because the mindshare and code
ecosystem that grew up around it got completely blindsided by modern module-
loading/packaging systems. The same is true of Angular I think but to a much
lesser degree.

------
dj_doh
Longevity and robustness of jQuery is hard to match. 10+ years for a software
project is amazing. Hopefully, in next few years pure ES6 (and later ES7) will
give us that joy that's been missing.

------
2pointsomone
This was thoughtful, touching, and very emotional making! Thank you for
writing / sharing this. Very much share the feelings.

------
pramodliv1
I wish someone builds a jQuery-like API for Android. Will definitely back it
on KickStarter. Is it going to be React-native?

~~~
wh-uws
Seems to have stagnated but someone has

[https://github.com/phil-brown/droidQuery](https://github.com/phil-
brown/droidQuery)

------
jnbiche
jQuery was invaluable 5+ years ago, but luckily it's not needed for most
modern web projects, unless you need to support old IE browsers. Even then,
it's worth seeing how many calls you really need to make that are not
supported across your target browsers.

~~~
joshmanders
> but luckily it's not needed for most modern web projects, unless you need to
> support old IE browsers.

I disagree. While I am building our actual app in Angular, our landing page
and that still uses jQuery for things such as ajax requests. There's no need
to pull in any major framework like Angular for such tasks.

jQuery still has a lot of relevancy in the web.

~~~
bgarbiak
I would say the landing page is exactly the case where jQuery is _not needed_
anymore. Yes, it's convenient to use, yet for a mostly static page with a few
XHR calls, some DOM interactions and whatnot - it's a bloat, actually. 12-16
months ago it would be a sabotage in most cases, but once it's all OK to
forget about IE8 - you really can put the good ol' DOM-AJAX-animation JS
libraries to rest.

From personal experience: just few days ago I've made a landing page. Focus
was on mobile and performance so no jQuery, modernizr, lo-dash, and so on. We
only grabbed some syntatic sugar from microjs.com so we could write
_$(el).remove()_ instead of _el.parentNode.removeChild(el);_ , etc.

Turned out a nice, little page with all the usual bells and whistles only
really needs a 12KB of JavaScript code (uncompressed). We actually missed lo-
dash more than jQuery.

In age of "modern browsers'" ubiquity, and Angular/React/Ember/MV* libraries
doing the heavier stuff, the support for older IEs is really the last selling
point of jQuery. And that goes away soon.

P.S. Very handy:
[http://youmightnotneedjquery.com/](http://youmightnotneedjquery.com/)

~~~
ForHackernews
> it's a bloat, actually.

I mean, it's like less than 30kB minified+gzipped, and if you load it from a
CDN, then there's a 95% your users already have it cached.

I guess it's technically a "bloat" but unless all your images are gzipped
SVGs, it's almost certainly one of the smaller elements in your page.

~~~
jnbiche
Unless you're using the unversioned ("latest") jQuery version on your CDN, the
browser cache hit rate will be way less than 95%. I've seen some estimates at
less than 20% (can't find the link at the moment).

And for various reasons, it's not a terribly good reason to use the "latest"
jQuery version with no version, unless you're prepared to deal with sudden
code breakage.

