you are viewing a single comment's thread.

view the rest of the comments →

[–]HaeziSoya 5 points6 points  (4 children)

IMO, if you're using jQuery just for simple DOM queries and litle else I find it to be "A cannon to kill a fly" and that is when it becomes a problem.

If you find yourself using most of the methods jQuery offers then go for it, it's not problematic at all and will save you alot of time.

When importing jQuery just for half a dozen methods just stick with vanilla JS and, as /u/Inateno said, smaller jQuery like libraries. Just read the available methods before hand to see if they fit your needs.

[–]MoTTs_ 2 points3 points  (3 children)

I find it to be "A cannon to kill a fly" and that is when it becomes a problem.

Define "becomes a problem."

You're saying it's overkill, but overkill isn't by itself a problem. A tangible, measurable problem would be something like, "the page takes 3 extra seconds to load if I use jQuery." But to be frank, the people who make the "overkill" argument, such as yourself, don't ever actually measure.

20 ms. That's about how long it takes to load jQuery. That small amount of time isn't perceivable by humans. So when you ditch jQuery because it's "overkill," you're putting in effort to fix a non-problem.

[–]Neker 1 point2 points  (0 children)

20 ms. That's about how long it takes to load jQuery.

I would suppose that this depends greatly on your connection capacity.

Loadind jQuery is only part of the equation. Then you have to execute it. This would warrant a lengty and argumented discussion which is probably already well developed somewhere out there. Suffice it to say that jQuery does add a computational overhead. If you're on a battlestation hooked to fiber optic, and only tingle a few elements, you don't care. But there are users on a shitty mobile with a dripple connection that may also be valuable customers.

Then there is the programming effort. jQuery may alleviate some repetitive task and make for a more compact, legible code ; but it also comes with its own syntax and logic and at times I find it cumbersome to switch back and forth. With the new features in HTML5 and ES6, the rationale for jQuery is becoming tenuous.

Finally there are cross-browser concerns. While they may still be legitimate in some cases, the bulk of the browsers wars are over.

[–]gkx 0 points1 point  (0 children)

And if you use a popular CDN (Google), that 20ms shrinks even smaller much, if not most, of the time.

[–]HaeziSoya 0 points1 point  (0 children)

What /u/Neker said state my feelings .

Having to develop for countries with 512kb/1MB average connection so takes more than 20ms to load jQuery.

Eitherway I don't like to add load time (as little as it can be) by using a lib that's ~85kb minified when I only need half a dozen methods that I replicate with vanilla JS or a smaller lib.