Live data from Hacker News

You Don't Need JQuery

blog.garstasio.com

61–70 of 201 posts

Re: You Don't Need JQuery

#61
post #49

Earlier quoted context omitted.

There is a lot of misconceptions here. There are two parallel tracks of JQuery maintained, with _identical functionality_, one which supports IE8 and less, one which doesn't. JQuery team is supporting both. If they don't behave identically, that's a bug. If you don't need IE8 or less support, you can use the smaller higher-performance JQuery that doesn't support IE8. If you do need IE8 or before you use the other var…

Thanks for the detailed response, that is clearly my mistake. I did an install from NuGet and went with 2.1.1 making an assumption that the latest build was the greatest build and not really doing a lot of research. On my end, it was a browser compatibility mode setting and a meta tag resolved the issue for just my site and is fine for the usecase.

Yep, they've failed at making it clear.

Hopefully the change to calling the variants "JQuery Compatibility" and "JQuery" will help -- although since they are still saying they recommend "JQuery Compatibility" for most sites, I think they should have called it "JQuery" (the compatible one) and "JQuery Future" or "Jquery Non-Compatible" or whatever.

Anyway, you also could have simply dropped in the equivalent JQuery 1.x version for old-browser-compat with no changes to your code.

Re: You Don't Need JQuery

#62

Every time I try to build something without jQuery, I regret it. Not because of selectors, that's (sometimes) easy to do for lots of (basic) selectors. Not because of DOM manipulation, as long as you're willing to sacrifice simplicity and readability, you can build iterative loops to modify a collection of HTML elements. No, it's the unexpected things that cause me pain. Want to use event handlers on dynamically gene…

I've only used jQuery once, for a client who insisted we use it, and it was the worst experience of my company's life. It only made us use bold on all our documents which proudly states, "No JQuery!".

Re: You Don't Need JQuery

#63

This guy's argument is strikingly similar to that of the one made by those people who are anti-Apple, despite the fact that working with Apple products is a commonly pleasant experience, simply for the fact that they're Apple. Just because a lot of people use something that they're not being forced to use doesn't necessarily mean that they've been "tricked" into doing so.

Using Apple products is a pleasant experience. Using jQuery is to avoid learning how to code while purporting that it makes things easier cross browser. Of course, if that were the real reason, we would also have cQuery and c++Query and so on but, instead, we just learn how to code.

Re: You Don't Need JQuery

#64
post #26

Earlier quoted context omitted.

.classlist() [1] is coming [2]. It'll allow you to do: document.getElementById('foo').classList.remove("bold"); Sure, it's still more verbose. But a lot of what jQuery does is slowly being obsoleted by better native javascript apis. [1] https://developer.mozilla.org/en-US/docs/Web/API/Element.cla... [2] http://caniuse.com/#feat=classlist

So when those new native api functions arrive, jQuery will start using them and gain some performance boost (using native vs. custom js code) while at the same time remaining backwards compatible (by doing feature detection). No one wants to write their own feature detection code so this whole page about using native apis is instead of jQuery is ridiculous. If the point of that website was to educate people on the ap…

Exactly. "No one wants to write their own feature detection code" is the whole point of jQuery.

Re: You Don't Need JQuery

#65

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.

Re: You Don't Need JQuery

#66

Every time I try to build something without jQuery, I regret it. Not because of selectors, that's (sometimes) easy to do for lots of (basic) selectors. Not because of DOM manipulation, as long as you're willing to sacrifice simplicity and readability, you can build iterative loops to modify a collection of HTML elements. No, it's the unexpected things that cause me pain. Want to use event handlers on dynamically gene…

I've only used jQuery once, for a client who insisted we use it, and it was the worst experience of my company's life. It only made us use bold on all our documents which proudly states, "No JQuery!".

Surely you can expand on this story. What made using jQuery so painful?

Re: You Don't Need JQuery

#67
post #12

Here's a list of DOM bugs in browsers that jQuery works around: https://docs.google.com/document/d/1LPaPA30bLUB_publLIMF0Rlh... Pretty sure they're not all fixed, and this is just the ignorance du jour.

So many of the author's examples required different bits of code for different browsers. It's almost like they don't understand why people use jQuery and just chalk it up to ignorance when using a framework it's almost a necessity these days. It's this stupid "you're not a real developer unless you're twiddling bits on your hard drive with a magnet" mentality that I absolutely despise.

It's a page and a half of mostly IE bugs. You should know your bugs and not try to cover them up but, more troubling that you don't want to know these things. Programmers I know want to write code, especially things as insignificant as these.

Re: You Don't Need JQuery

#68
post #20

Lots of blanket statements in this article. He asserts there is a 'proper' order to learning JavaScript but makes no demonstration of that assertion. For me, jQuery was a gateway that hid much of the incidental complexity of working with a byzantine API (the dom). That was incredibly useful. If every beginner started with trying to understand the DOM, they'd probably be scared off (and rightly so).

What you call Byzantine, I call normal. Some things are harder to learn than others but you can't throw your hands up in the air and let someone else (jQuery) do the simple things for you.

Working with the DOM is what we programmers do. I've never seen so many people complain so much about programming than those who use jQuery.

Re: You Don't Need JQuery

#69

Every time I try to build something without jQuery, I regret it. Not because of selectors, that's (sometimes) easy to do for lots of (basic) selectors. Not because of DOM manipulation, as long as you're willing to sacrifice simplicity and readability, you can build iterative loops to modify a collection of HTML elements. No, it's the unexpected things that cause me pain. Want to use event handlers on dynamically gene…

greenspuns-tenth-rule.js

Re: You Don't Need JQuery

#70
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…

It's like saying "You don't need a web browser at all -- See how we can navigate the web using cURL!"
Post reply on HN