Live data from Hacker News

I loved jQuery, and still do (2019)

withblue.ink

21–30 of 189 posts

Re: I loved jQuery, and still do (2019)

#22
post #5

Earlier quoted context omitted.

That's 30KB over the network and 90KB of JS code in memory so that you don't need to learn about 5 standardized browser API methods that are the same in every browser going back to IE9 then. No doubt that gives you a better developer experience but I don't think your users are thanking you.

I'm not happy about it, but the reality is that 120kB is small potatoes in the modern web world. Would it be better without, sure? But there are bigger fish to fry. If jQuery helps the developer achieve their design and development goals, that will play out better for the end-user. It's not ideal, but it's realistic.

If jQuery helps the developer achieve their design and development goals, that will play out better for the end-user.

That's not the dilemma though. Developer can build solutions without jQuery. They'll be faster, smaller, and have fewer dependencies.

Plus, if you're only using jQuery for DOM and events then it probably isn't helping you. Those are two areas where writing vanilla JS is can often be easier than writing the jQuery code to do the same job.

Re: I loved jQuery, and still do (2019)

#24

jQuery is still my bread and butter for DOM manipulation and events. I've found it to be much more readable than vanilla JS.

Can you elaborate on what JQuery does for you that you can't do with modern JS features such as fetch and query selectors?

For me, the code is easily 10x more readable than vanilla JS. And much shorter, so I can hand code everything quicker without typos.

Re: I loved jQuery, and still do (2019)

#25

jQuery is still my bread and butter for DOM manipulation and events. I've found it to be much more readable than vanilla JS.

Can you elaborate on what JQuery does for you that you can't do with modern JS features such as fetch and query selectors?

To use an example, I'd much rather do

$(".elements").css("color", "red")

versus

var selector = document.getElementsByClassName('elements');

selector.style.color = 'red';

Re: I loved jQuery, and still do (2019)

#27
post #5

jQuery is still my bread and butter for DOM manipulation and events. I've found it to be much more readable than vanilla JS.

That's 30KB over the network and 90KB of JS code in memory so that you don't need to learn about 5 standardized browser API methods that are the same in every browser going back to IE9 then. No doubt that gives you a better developer experience but I don't think your users are thanking you.

30kb is pretty trivial. And even so, if you are using a CDN like you should the jQuery is likely already cached on the user device.

Re: I loved jQuery, and still do (2019)

#28
post #17

Earlier quoted context omitted.

I don’t follow. Is the implication here that users can identify an experience difference cause by a 30KB over-the-wire asset, or more, a 90KB in memory one? I know I certainly wouldn’t claim to have that ability myself even on low quality networks.

If you're a user on a spotty mobile connection in a rural location on a low-end device ... both.

In that case, most of the web is unusable nowadays, and jQuery is not your main problem. Maybe your argument is valid in less-developed countries where more people have spotty connections and more websites have adapted to that (but I wouldn't know, sorry).

Re: I loved jQuery, and still do (2019)

#29
post #7

Earlier quoted context omitted.

The internets users managed to live with this terrible 30k burden in the late 2000's when it was the only choice. I think probably in 2021 when 30kb is a rounding error on page sizes they can also probably manage it.

This feels like a false equivalence; how many of those 2000s users were browsing the web on mobile compared to today?

Does 30kb of js really matter on modern phones and modern mobile internet?

Re: I loved jQuery, and still do (2019)

#30

Yes Jquery does makes things easier than vanilla JS Best being $("#id") replacing document.getElementById("id"); Makes code look cleaner

https://developer.mozilla.org/en-US/docs/Web/API/Document/qu...

Does the same as the $ query but native in every browser in IE9+ and gives you a native node. Also more performant than getElementBy methods.

Post reply on HN