Live data from Hacker News

You Don't Need JQuery

blog.garstasio.com

71–80 of 201 posts

Re: You Don't Need JQuery

#71
post #7

You can basically sum up this entire rather ridiculous site with "Yes, you don't need jQuery, you can just use the built-in methods, but using jQuery is generally more pleasant, more consistent, and involves less typing". One particularly egregious example from the site: $('#foo').removeClass('bold'); vs. document.getElementById('foo').className = document.getElementById('foo').className.replace(/^bold$/, ''); The au…

or you can use just what js you need instead of loading pages down with dozens of bloated js library's and wondering why your site sucks and is slow as a slow thing

Re: You Don't Need JQuery

#72
Next up: you don't need Underscore/Lodash!

Forget this "you don't need JQuery"...JQuery, the entire library, is basically an API bug report against the DOM! What browsers need to start doing is get off their butts and start implementing a real selector implementation like Sizzle. Reduce JQuery to set of polyfils after that.

As for IE7 support. Sorry that still accounts for too much of my traffic to ignore.

Re: You Don't Need JQuery

#74
post #57

I do need JQuery because I want to focus on the application and not nuances of different js implementations. And I want to use the simple selector mechanisms. Then there's plugins, I use those too and many assume/require JQuery. So no, I disagree. Stupid article.

The article is controversial but it is definitely not stupid.

Re: You Don't Need JQuery

#75

Right off the bat, on the first 3 examples, he shows how you need to use different APIs depending on the IE version. That alone is enough reason to use jQuery and not having to bother.

You're pointing out an IE problem, not a javascript problem that isn't present in other browsers.

It's a developer's problem.

Re: You Don't Need JQuery

#76

Right off the bat, on the first 3 examples, he shows how you need to use different APIs depending on the IE version. That alone is enough reason to use jQuery and not having to bother.

You're pointing out an IE problem, not a javascript problem that isn't present in other browsers.

And your point is? Pointing the blame at a different source doesn't mean the problem isn't present. If a client needs IE support, what do you do? Write the code three times? Detect IE and redirect the user to chrome-frame, then cry when you don't get paid?

I don't care who caused the problem. Just that it wasn't me, I can't fix it, and I have a deadline to meet and constraints to follow. jQuery is a lifesaver.

Re: You Don't Need JQuery

#77
Imperative DOM manipulation is a pain one way or another. React does a great job of alleviating this pain by allowing for declarative DOM manipulation, but it would be great to be able to do this without needing the rest of React.

Re: You Don't Need JQuery

#78

Next up: you don't need Underscore/Lodash! Forget this "you don't need JQuery"...JQuery, the entire library, is basically an API bug report against the DOM! What browsers need to start doing is get off their butts and start implementing a real selector implementation like Sizzle. Reduce JQuery to set of polyfils after that. As for IE7 support. Sorry that still accounts for too much of my traffic to ignore.

Are you aware of QuerySelectorAll? I think Sizzle does more but I expect internally most of it delegates to that when available by now - it should support all CSS selectors. https://developer.mozilla.org/en/docs/Web/API/Document.query...
Post reply on HN