Live data from Hacker News

You might not need jQuery

youmightnotneedjquery.com

11–20 of 360 posts

Re: You might not need jQuery

#11
> in truth, post-IE8, browsers are pretty easy to deal with on their own

I totally agree, but not everyone lives in a post-IE8 world. It's as much as 10% of our traffic on some sites and several big clients use it.

Re: You might not need jQuery

#12

Chaining and implicit iterators.

Since I've started using an MVC, I use chaining less and less. I tend to just use a variable the few times I need to do a bunch of manipulation to the same element. Beyond that, any chain using .end is nuts to me.

Re: You might not need jQuery

#13

I understand the desire for people to make pages like this (this isn't the first), but the examples are not completely honest with themselves, in my opinion. One of the biggest benefits jQuery introduces is the concept of treating single selections and multiple selections identically. While using jQuery, I can emit a $(".class").hide() call, which will apply to all elements with the matching class. Simple and elegant…

Those sort of selections are not specific to jQuery. Most DOM libraries have had them for a while, and browsers (IE8+) have provided it for some time as well in QSA: https://developer.mozilla.org/en-US/docs/Web/API/Document.qu...

Re: You might not need jQuery

#14

I understand the desire for people to make pages like this (this isn't the first), but the examples are not completely honest with themselves, in my opinion. One of the biggest benefits jQuery introduces is the concept of treating single selections and multiple selections identically. While using jQuery, I can emit a $(".class").hide() call, which will apply to all elements with the matching class. Simple and elegant…

I agree with most of your points.

However, your Sizzle example is covered by document.querySelectorAll: https://developer.mozilla.org/en-US/docs/Web/API/DocumentFra...

Re: You might not need jQuery

#15
It's hard to tell if this site is advocating for ditching this type of js library altogether and writing all those replacements inline (ick for some of those) or simply replacing jQuery with a thinner (and narrower) library.

I could be convinced of the latter but not the former.

Re: You might not need jQuery

#16
post #9

There are many things you don't need to do. I'll take the time saved in development over cutting out an extra framework.

Like it says at the top of that page:

> jQuery and its cousins are great, and by all means use them if it makes it easier to develop your application.

Re: You might not need jQuery

#17
What's a good resource to read up on how browsers handle unsupported JS, if I want to write a fall-back?

I've already got fall-back for people who've turned off JS, but I've yet to write anything for unsupported JS.

Re: You might not need jQuery

#19

I understand the desire for people to make pages like this (this isn't the first), but the examples are not completely honest with themselves, in my opinion. One of the biggest benefits jQuery introduces is the concept of treating single selections and multiple selections identically. While using jQuery, I can emit a $(".class").hide() call, which will apply to all elements with the matching class. Simple and elegant…

You're certainly right. Did you see that the page specifically targets people who make javascript libraries? The page is arguing that when possible, libraries shouldn't depend on jquery, and shows how to do that for a few common idioms.

Since a library is written once and used in many different places, it's worth going to a little more effort to make it more flexible.

Re: You might not need jQuery

#20
post #11

> in truth, post-IE8, browsers are pretty easy to deal with on their own I totally agree, but not everyone lives in a post-IE8 world. It's as much as 10% of our traffic on some sites and several big clients use it.

That's why it's called You_Might_NotNeedJQuery. ;)
Post reply on HN