
10th Anniversary of JQuery - shawndumas
http://ejohn.org/blog/10th-anniversary-of-jquery/
======
jdonaldson
I would argue jquery has been more instrumental to the success of the web than
javascript. It was the stroke of pragmatic genius riding the back of a half-
baked language ( a prototype-based language trying to ape the style/name of
Java, solely as a cheap cash in of its popularity).

~~~
wambotron
I don't think that's accurate (or fair, really). Jquery was one in a list of
dozens of libraries that did similar things at that time, but
ajax/interactivity had been part of the web mindset for years before jquery
existed. Jquery just won the library war.

~~~
underwater
jQuery was important not just because of the feature set, but because it
completely dominated the industry. jQuery and its ecosystem of plugins created
a single community for JS developers. A lot of subsequent work wouldn't have
been as successful without that strong community in place to spread ideas.

The other thing it did well was change the thinking about how JavaScript
should interact with the DOM. In the past you'd have libraries that made DOM
access easier, but they largely followed the same conventions as the underling
APIs. jQuery broke from that and completely re-envisioned the API layer. The
underlying APIs were treated as an implementation detail; this approach is
something that subsequent libraries have adopted too.

~~~
vatotemking
Exactly. Method chaining was a novel feature back then

------
qwertyuiop924
JQuery is a brilliant library. No, really. It's designed to make DOM
manipulations easy, and it does that REALLY well. I'd go so far as to say that
it probably has one the the best interfaces of any library ever.

~~~
ohitsdom
Completely agree. Strong evidence for this too when you view his link to his
annotations on one of the first versions. The API hardly changed.

~~~
qwertyuiop924
Also, JQuery is monadic
([https://importantshock.wordpress.com/2009/01/18/jquery-
is-a-...](https://importantshock.wordpress.com/2009/01/18/jquery-is-a-monad/))

~~~
qwertyuiop924
Okay, apparently I'm wrong about that.

------
ry_ry
Happy birthday jQuery!

It is currently my 3rd most endorsed linkedin skill after 'dressing himself'
and 'marking recruiters as spam'. My friends suck.

~~~
ourmandave
Then we have some great opportunities requiring 15+ years of JQuery experience
in your area. As you're able to dress yourself these are not remote roles. =)

</spam>

------
anindyabd
Slightly unrelated -- John Resig's "Secrets of the JavaScript Ninja" is such a
well-written book. It allowed me to not only understand but also appreciate
JavaScript. I believe understanding JavaScript as a functional language is key
to being a good JS developer.

~~~
sotojuan
And there's a second edition coming out soon:

[https://www.manning.com/books/secrets-of-the-javascript-
ninj...](https://www.manning.com/books/secrets-of-the-javascript-ninja-second-
edition)

------
BinaryIdiot
So it's been 10 years of jQuery being a preferred way of interacting with the
DOM API...where are the changes to the DOM API to make the DOM easier like
jQuery? Sure we got a few new things like querySelectorAll(), etc but nothing
that makes things quite as elegant to create as jQuery's API.

Why wouldn't the HTML standards committees follow the trend and improve the
API?

Edit: removed 'chainable' as a descriptor of jQuery's API as I didn't mean to
focus on it; was simply just calling its API chainable but it's led to
confusion.

~~~
ergothus
Actually, I don't think the chainable API is terribly important.

The things that keep jquery alive and well in mind are:

* A convenient way to add to the DOM. While SELECTING elements has gotten way better than the Bad Old Days, ADDING elements is still painful. (one element isn't bad, but if you're trying to add, say, a UL with a number of LI elements, it's...tedious.)

* A good wrapper for Ajax calls. Not that there aren't better, but jquery has a perfectly good one. Heck, I've jqueryified a page to test calls I'm making outside of jquery because doing a call via console is...tedious.

* Promises. We'll soon have them native (and better), but for a long time jquery has been super convenient for this.

~~~
skrebbel
for HTTP calls from the console, you might appreciate the relatively new fetch
api:

[https://developer.mozilla.org/en/docs/Web/API/Fetch_API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API)

if you ask me, it's impressively well designed. it looks so boring and
straight forward yet somehow nearly all "simple" http libraries (not to
mention builtins) in nearly all popular languages are more convoluted.

~~~
amirmansour
I'm really greatfull for the new Fetch API. For now we need to use a pollyfill
for it which just uses XHR underneath. Safari and modern versions of IE/Edge
are lacking support.

------
dugmartin
I remember sitting in a tiny conference room at Monster.com during the first
Boston BarCamp in 2006 and listening to this kid from RIT give a talk to maybe
15 of us about his new library called jQuery. I think I asked some dumb
question about if method chaining allowed for conditionals.

~~~
overcast
Awesome! Resig was a few years after my time there, but it's always good
hearing RIT associated with someone so game changing.

------
ddoolin
Somewhat unrelated but reminds me of this: I enjoyed skimming through Resig's
personally-annotated version of the first public release of jQuery (annotated
April 2015 of the release in 2006 [!]).

[http://ejohn.org/blog/annotated-version-of-the-original-
jque...](http://ejohn.org/blog/annotated-version-of-the-original-jquery-
release/)

~~~
Mahn
Not so unrelated since he links to it right in the second paragraph :)

------
hoorayimhelping
jQuery is the BMW M3 of libraries. It handles all the hard stuff for you in
such a way that when you use it, you look like a superhero capable of
anything. It's one of those rare tools that makes almost everyone better at
what they do just by the fact that they're using it. And everyone can find a
way to use it in their own style. Just a completely brilliant piece of
software that has inspired me (and many others) for a decade.

I'm still waiting to meet John in real life and thank him out loud for jQuery.
One of these days.

------
merqurio
I personally got into web development with jQuery. Some years I go it was a
must, now a days, I find it unnecessary and I don't use it any more. Is this
just me or is transition people is doing ??

~~~
savanaly
I can think of two main areas that jQuery is useful in which have diminished
in importance over the years

a) smoothed over differences between browsers. With the web being taken more
seriously by everyone, the browser implementers are much more careful about
all following the same standard so with every year that goes by there are
fewer cross browser quirks to worry about (it's still a major pain today
though)

b) providing convenience methods for manipulating the dom and working with
data etc. I think jQuery has less of a role to play since ES5 and ES6 are how
javascript is written nowadays and have more advanced features than js did in
jquery's heyday. Also, for advanced client side apps, frameworks like angular
and ember also provide such features.

~~~
hellofunk
Google Closure also satisfies these, no?

------
ralmidani
From the perspective of a passionate user of Ember, jQuery is still relevant.
The DOM API may be more consistent between browsers today than it was in 2006,
but it is still needlessly verbose:

document.getElementById(id)

vs.

$('#' \+ id)

Let's not forget the lack of chainability in DOM element method calls:

el = document.getElementById(id)

el.method1()

el.method2()

vs.

$('#' \+ id).method1().method2()

Yes--to me at least--conciseness and elegance matter, now more than ever. A
better DOM API does not mean the end of jQuery. In a similar vein, ES6 does
not spell the end for CoffeeScript.

~~~
bobince
On the other hand, `$('#'+id)` fails when the ID contains dot or other
characters that have special meaning in a CSS selector, and `$(selector)` is
overloaded with `$(html)` causing common XSS injection issues in apps misusing
it. jQuery's “Do What I Mean” philosophy jas introduced as many of its own
bugs as it ever fixed in browsers; I wish there were a happy medium.

------
pacomerh
I'm still looking forward for programmatically generating custom jQuery builds
from the download page. We Inertially include the whole build for minor things
sometimes. Say I want to just use Events, Selector, or Utilities and Ajax.

~~~
swang
I used this when I only needed the $.ajax part of jQuery:
[http://projects.jga.me/jquery-builder/](http://projects.jga.me/jquery-
builder/)

------
franze
a) jQuery is a great piece of beautiful, battleproven code!

b) jQuery was necessary for a long time to have (efficent) fun with the DOM
(i.e.: my contribution
[http://www.fullstackoptimization.com/box2d-jquery/](http://www.fullstackoptimization.com/box2d-jquery/)
)

c) Damn, I'm glad that the days of jQuery necessity are (nearly) over. It's a
ghetto.

------
EdSharkey
I started using JQuery in 2007 or 2008, and it helped me put bread on my table
for years. Thanks John!

------
hammerbrostime
I remember when it was announced - I just happened to be in the right place at
the right time. It was announced in a smallish room, maybe about 25 people. At
BarCamp, if I remember how it worked, everyone who showed up was required to
talk about a subject. It was as community-driven an event as any I've ever
been to. Lots of amateur presenters.

There was a guy there that John Resig had shown jQuery to the night before,
and the guy was just raving about it. And when John showed off jQuery, it just
was damn impressive.

Wish I could remember more, its a bit of a hazy memory now! :)

~~~
blhack
Sounds like you weren't the only person in that room who is posting here
today:
[https://news.ycombinator.com/item?id=10903725](https://news.ycombinator.com/item?id=10903725)

:)

------
jpea
I do love that John's blog doesn't actually use jQuery itself (likely because
it's not needed in this instance). Or any javascript for that matter, other
than analytics...

------
randomdrake
There's a lot of nifty front-end JS frameworks these days, or popular front-
end and back-end JS implementations, so I can see how it's easy to miss what
made/makes jQuery great.

I think that it's hard to truly appreciate jQuery unless you were actually
attempting to write code for web applications that dealt with a lot of
JavaScript at the time. 2005 and 2006 was a nightmare for writing front-end
behavior on web-based applications.

This wasn't because JS was particularly awful to write code in. Internet
Explorer, the king of browsers at the time, routinely exhibited totally
unexpected behavior with little to no tools to discover how to fix things.
While this may sound like a personal attack against Internet Explorer, it's
the truth of the matter. Other browsers had quirks, but none were as important
as the quirks discovered in the most popular browser at the time.

The things that you wanted to start doing to make your app "Web 2.0" like
transitions, CSS animations, AJAX behavior, big DOM manipulations, and so on,
were totally _possible_ with JS. You just had to write a _lot_ of it and pray
to whoever you wanted when you went to test it in IE.

One of the big catalysts for getting something better than vanilla JS to play
with wasn't just to make writing the code more pleasurable, it was to make it
easier to GSD. Two camps came out in this regard. You had folks who were
abstracting away the JS a lot more, creating more of their own syntax and
language for everything; a framework built in JS. Then there were folks like
jQuery who were creating what a lot of people considered a library, in that it
felt like you were utilizing a lot of the same vanilla JS you knew and loved,
but with some wrappers and helpers.

I mean, AJAX was a big and cool "aha" moment when you first saw it and played
with it. But the first time you got to do things like:

* Identify an element without verbosity like document.getElementById()

* Attach an onclick to elements _reliably_ and in a cross-browser safe way

* Change the color, replace some text, and fade in or shake or whatever was cool at the time in a _single_ line of code that worked everywhere

... things like these were also very, very cool.

And because jQuery was well-documented, and didn't change the language and
feeling of using a lot of JavaScript too tremendously, it was, and continues
to be, an invaluable tool in so many belts. There are tons of good libraries
built on top of jQuery that continue to evolve with standards and trends.

Overall it's stood the test of time well, and has saved countless hours of
development time; two important qualities in great software.

~~~
elliotec
I strongly believe that jQuery by itself is almost always easier to use than
any JS framework or combo of libraries. The fact that these frameworks often
are incompatible or at least look down upon jQuery is odd and dare I say
disrespectful.

~~~
gedy
I think what a lot of folks frown upon about "jQuery" (sometimes without
realizing) is using the DOM as your data model. I.e. state is only stored in
text, attributes, tags, etc. - and apps quickly turn to crap due to the
complexities of back and forth data binding, etc. It's not really about
jQuery, just that style of coding.

~~~
elliotec
Yeah for sure, I think it's mainly a lack of structure which has also been
solved in various forms, none of which necessarily prevail.

------
tim333
jQuery is great and conceptually quite simple - select an element of your page
and do something to it in a line or two. It's a shame that the React/Angular
stuff doesn't have that kind of simplicity. I'm not sure if that's inherent to
the problems they deal with or not.

------
edko
It is incredible that it has "only" been ten years. It somehow feels that it
has been around forever.

~~~
sosborn
I find the relativity of time so interesting. To me it feels like JQuery came
out yesterday.

------
html5web
Same day as my birthday!

------
frik
Suggestion: read his book "Pro JavaScript Techniques" (2006), it explains how
JQuery works. Even if you don't use JQuery, one can find several good code
snips and advises.

~~~
dominotw
this is how i learnt javascript. Has to be the most underrated javascript book
ever.

------
seivan
Hmm, is there any reason to use jQuery if you handle your DOM with React?

I might be missing something. I used to use it for animations and manipulating
DOM, but there are decent lighter alternatives now.

------
k__
JQuery got created about 10 months before I started doing professional web-
development so it was there for my whole career, but I never used it, I just
read a book written by its maker.

Till 2011 I had to use a framework that was a bit like GWT in PHP, because the
company just had PHP and C coders and no one wanted to pay a switch.

2011 I started with JS and read stuff like "The Good Parts" and "Professional
JavaScript". I wrote a JSON-HTTP-API and rewrote the whole UI in ExtJS.

Then I took a sabbatical in 2014 where I played around with Crafty, Phaser, D3
and continued my masters degree where I had to use Ember for a few projects.

Last year I dropped in a young project that was using React.

Funny thing is, all the time JQuery felt really old to me, so I never
considered using it.

~~~
elliotec
You never considered using jQuery, but you had to use Ember for a few
projects? Do you realize what you're saying?

~~~
k__
I probably used a bunch of libraries that had a JQuery dependency in my life.

Maybe I should have been clearer?

I never called its API "personally" ;)

