Live data from Hacker News

I loved jQuery, and still do (2019)

withblue.ink

31–40 of 189 posts

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

#31

Django templates + Bootstrap + jQuery is all I've ever needed to make great, modern websites. Server-side rendering with some nice layouts and interactivity on the frontend. I've tried some of the SPA frameworks and I've always felt like my productivity tanked.

In General I agree, but using a SPA framework has one major benefit. It forces you to make an API for everything. So when a request comes in to make something more dynamic you have everything you need ready to go. Also, if you're building an app that some users need API access for, it's already there.

I daydream about making a framework that lets me use django templates as a SPA that does server side rendering on the first request, or when javascript is unavailable.

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

#32
jQuery used to be (necessarily) bloated because it needed to support so many poorly-behaving browsers.

Now that these browsers are no longer relevant and support has been removed from jQuery, what is the performance hit, if any for using jQuery as opposed to vanilla JS?

I agree with many, I find the jQuery syntax to often be better than the alternative.

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

#33
post #10

I created box2d jQuery https://github.com/franzenzenhofer/box2d-jquery (Demo Pages sadly down) a physics engine for the DOM. I really learned to appreciate jquerys clean codebase at that time. Learned a lot about the DOM and how to misuse it.

That sounds interesting! Too bad it's down...

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

#34
I had a big post but deleted it all. I can more concisely say this:

The people here saying they still use it have so far demonstrated what I always say. If you're using jQuery, it's time to go back and relearn javascript. Most people should REALLY research the querySelector and querySelectorAll DOM methods.

I've always felt that jQuery encourages you to let your skills stagnate and you don't learn what your code is actually doing. Learn what the current spec has to offer. You don't need another dep just to target dom nodes ffs.

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

#35
I've depended on jQuery, not a strictly front end designer myself but have done a bit of client side dev the past 20 years.

If I had a choice, I'd go with one of the reactive libraries, I've used Vue. For me, if you're relying on Javascript IMO it gets the job done quicker.

It'd be interesting to see what jquery is used for in aggregation of all its usage. For me it was always selecting element(s) and XHR requests. With fetch (and a polyfill for IE), and the likes of querySelector it seems that a lot of the problems jquery solved have also been solved by the majority of popular browsers.

I say that as a layman of client side dev, happy to be corrected.

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

#36
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.

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.

I recall an earlier discussion on here stating that using CDN nowadays doesn't have any gains, only drawbacks.

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

#37

Earlier quoted context omitted.

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';

You can do

const $ = document.querySelector;

$('.elements').style.color = 'red';

Which is only marginally more verbose.

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

#38

I've depended on jQuery, not a strictly front end designer myself but have done a bit of client side dev the past 20 years. If I had a choice, I'd go with one of the reactive libraries, I've used Vue. For me, if you're relying on Javascript IMO it gets the job done quicker. It'd be interesting to see what jquery is used for in aggregation of all its usage. For me it was always selecting element(s) and XHR requests. W…

You're bang on here. Why import an entire library when once polyfill and native features will serve you nicely.

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

#39

Django templates + Bootstrap + jQuery is all I've ever needed to make great, modern websites. Server-side rendering with some nice layouts and interactivity on the frontend. I've tried some of the SPA frameworks and I've always felt like my productivity tanked.

Do you develop REST API also....?

The fundamental issue is that it binds the server to the client, who must understand HTML structure. It also makes it more difficult to reuse the endpoints in different ways or for new applications.

Returning data and letting the client render it decreases coupling and increases flexibility/testability- you can run unit tests on the client for mock data, and run unit tests on the server to test the desire

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

#40

I had a big post but deleted it all. I can more concisely say this: The people here saying they still use it have so far demonstrated what I always say. If you're using jQuery, it's time to go back and relearn javascript. Most people should REALLY research the querySelector and querySelectorAll DOM methods. I've always felt that jQuery encourages you to let your skills stagnate and you don't learn what your code is a…

i couldn't agree more!
Post reply on HN