Live data from Hacker News

Ask HN: Is jQuery on its way out?

news.ycombinator.com

51–60 of 60 posts

Re: Ask HN: Is jQuery on its way out?

#51
Well my litmus test regarding outdated way of doing stuff is the answer of the question "If I start a new project today, would I use 'x'?". Answer "no" means the technology is fading even for simple use cases.

Example, 'x' and 'No'-answer :

- jQuery / prototypejs / etc...

- Backbone

- CoffeeScript

- Perl, SVN, Java Applets :D

On the other hand you still have 'Yes'-es for some old tech-stack, since it is still acceptable to do a task with old technology. Example, 'x' and 'Yes'-answer :

- Form + POST requests / No javascript

- Pure CSS ( no SCSS, etc... )

- Handlebars, instead of React / Vue / you name it

Re: Ask HN: Is jQuery on its way out?

#52
I recently made a decision on the following front-end stack:

- Bootstrap 3.x

- jQuery

- KnockoutJS

because of the following reasons:

- The devices that will be accessing the web app may have older browsers, both desktop and mobile.

- My users will be in geography where network connection is sometimes slow.

- These libraries have been in the wild for very long time and time tested with lot of support available on public forums.

- Very easy to get started.

- As I am not primarily a front-end web developer, I am not in a position to handle various quirks of different browsers; if libraries such as bootstrap, jquery and knockoutjs handle that for me for older devices and browsers then it is useful.

If I had an option to go for a more modern stack, then I would have gone with svelte.technology, unpolyjs and bootstrap.

Re: Ask HN: Is jQuery on its way out?

#53
Angular and React is not what competes with jQuery. Its VueJS. Why? Because unlike React and Angular, you can use Vue in small dosages, ala jQuery. You dont need to write the entire HTML part as JS or JSX. Just insert Vue in parts you want to make "dynamic".

My current setup is to use Vue for interactivity and frontend axios for ajax. Works pretty well. No compiling/transpiling needed.

Re: Ask HN: Is jQuery on its way out?

#55
Only you can decide what tools are best for your projects. Jquery is javascript. It's a clever tool that often results in better, clearer, readable syntax.

Creative devs or "mid level" front-enders like myself enjoy its clean syntax and reliable operation. I am VERY thankful for Jquery in how it helped me understand and execute more difficult concepts, and complex interfaces, and gave me opportunity to make better things beyond my vanilla abilities.

Re: Ask HN: Is jQuery on its way out?

#56

Feel free to disregard this advice, I don't do anything in javascript. Whether or not it's worth becoming good at jQuery is essentially determined by your goals in life, and whether becoming good at jQuery in particular, is in alignment with those goals and also of high importance. Any time you spend honing one skill is time not spent honing another. You want to be sure to spend your time on the most important things…

Sure, but one can learn a great deal about Jquery in a short time. It's more accessible than the frameworks mentioned in OP.

Re: Ask HN: Is jQuery on its way out?

#57

Affirmative. It's not just that there are advanced application frameworks like React and Angular -- it's also that browsers are more standards compliant, and standard APIs have evolved in recent years to cover much of the gap that jQuery once usefully filled.

I made a diagram of the way I think about it here: https://plectica.com/m/ADUNN80H4 When you map it out like this, the answer seems obvious that the place to invest your time is in learning the standards.

Jquery selectors are still more powerful, even if vanilla is faster.

There's more options, more possibilities. The selectors are a core part of Jquery's strength. As soon as your project requires a bit more complexity in selector needs, that's when Jquery steps up and helps out. That's what I've found anyway.

Re: Ask HN: Is jQuery on its way out?

#58

Becoming good at jquery is a waste of time, yes, unless you have inherited a legacy project built in it. Jquery's strength was in its polyfills for older browsers for selecting elements and the like. Since it's introduction, browsers have pretty much replaced all of jquery's functionality intrinsically.

If learning a bit of Jquery (which is not hard) helps you get something from concept to client's screen faster, then it has its place.

> browsers have pretty much...

No, there's a bunch of selectors and methods that are much easier to work with, read and write using Jquery, IMHO.

Re: Ask HN: Is jQuery on its way out?

#59
post #44

I still use jQuery and won't be ditching it anytime soon. End users don't know or care if an app uses it or React/Angular/Vue. I've built SPAs with it and don't see why that's a problem for others who've mentioned it, but that's because I don't know what specific problems they ran into. I've not run into any. But, I also use CouchDB as a backend, almost all my app code is JS running in the browser, and I don't use No…

Most my work is generally in Mojolicious (with or without an Nginx instance proxying and providing SSL support, but I've found with Nginx easier), jQuery and Bootstrap. A while back I bit he bullet and learned a bit of Vue... and I have to say, it's pretty nice, even if I just use it as a way to build the page.

The main thing it provides is a sane toolset for what I was already slowly moving towards, which was templates in script tags (grabbed through jQuery), and my own home rolled templating in JS (it's just a few lines for something minimal). I get some JS from the server (or serve it on the page), and use a JS class to build the representation for display, but this allowed me to easily build the initial page and also get updated without a complete page reload and reliably update the page.

Vue is basically the same thing, but taken a few generations farther. You have a data structure, you define how to build the HTML from the data structure, and Vue tracks the data so if you change one five levels deep in the data structure, the page just updates accordingly (and it only updates the things that change, so half entered forms/text boxes don't lose all their state.

It's nice to just have to serve JSON, or a minimal HTML page with some JSON data in a script tag. No mixing Perl templating, and HTML, and JS anymore. At least for a select few new things I've deployed. It's not like I can just replace everything. I also forego the whole NPM and deployment stuff, and just include Vue with a script tag, and write my components either on the page, or in a JS file (or set of files) I can load, depending on whether the components have any use outside the page I'm writing them for. Dead simple.

If you haven't tried it Vue (and you very wel may well know everything I just mentioned about it already), I suggest you do one of the quick online tutorials to get an idea. It's actually a pretty cool idea (and since it's hard to get away from using JS anyway, you at least get to cleanly separate the front-end from the back-end).

Re: Ask HN: Is jQuery on its way out?

#60
If catering to older browsers, developers that aren't familiar with JS build/release tools or the latest fad/buzz then jQuery is still viable. jQuery used to be the easiest way of getting things done but now it is more of a tool. I loved jQuery but I have seen it abused so bad that it has become a design smell if the page/service gets too big. If you are doing simple things then jQuery will be ok but if it is a really complex page/site then using something like Vue or React may be appropriate just for ease of diagnosing problems/reasoning.
Post reply on HN