Ask HN: Does anybody still use jQuery?
I know that frameworks such as React and Vue have taken over most of the mindshare, but I still find jQuery easier to use and often more productive, especially for smaller websites.
Even when using a framework I usually include jQuery to smooth out the edges where the framework does not behave as I would have expected, or seems to make implementing a part of the intended UX awkward or complicated.
Is anybody else still relying on jQuery in some capacity, and if so, what value do you get out of it? Do you use it along with one of the major frameworks, or together with smaller libraries? And do you plan on dropping it soon?
44 comments
[ 4.5 ms ] story [ 96.0 ms ] threadIf you're doing projects with light functionality and already know jQuery cold, you really don't gain much from React, Vue, et al for that project. You may gain something personally (career path, different way of thinking, etc), but that is a different topic.
For anything slightly above the basics, I'd recommend Vue as a great alternative to jQuery. No build tools required and it's easy to stay in the realm of plain HTML, CSS, and JS. It also "progresses" really nicely if you have more complex needs later on -- that would be a main benefit over a tool like jQuery.
Since then, I had one project where using jQuery and jQuery UI was dramatically easier than building out a datepicker input by hand; however, for everything else, vanilla js is my go to.
https://trends.google.com/trends/explore?date=today%205-y&q=...
5 years ago, jQuery was twice as popular than it is today. But I wouldn't call it dead just yet. It's a work in progress.
By the way - one of the things that killed jQuery is HTML5, it's not only Vue and React for more advanced features, a lot of people used jQuery for basic DOM manipulation, which today you can probably get away with just fine with the HTML5 DOM API, since the addition of the querySelector APIs and things like CSS's classList APIs.
Marketing + meme.
Have you got numbers to support that? Because I think it's wrong.
If you want some numbers, compare e.g. the dates on popular HN posts for jquery[1] vs react[2] and vue[3]. Most popular articles for jQuery are 4-6 years old, while for React and Vue the popular stories are much more recent. Of course, HN might be somewhat special.
[1]: https://hn.algolia.com/?query=jquery [2]: https://hn.algolia.com/?query=react [3]: https://hn.algolia.com/?query=vue
In hindsight I have been guilty of resume-padding and falling prey to hype by choosing to build on technology not appropriate to the problems at hand. And I find myself reverting back to basics, with bits of new tech sprinkled in.
My reversions:
I can do this because I have chosen to work on niche problems and smaller markets. Scale is not my issue, even in very successful scenarios.I see jQuery will have a place in my stack for some time to come. It just works (tm), and it plays well when I need to level-up with wither intercooler or yes -- backbone.
Another benefit is that it is a low barrier to entry for junior developers. It allows me to establish a baseline knowledge, and then mentor other things like workflow, code structure, and architectural things rather than chasing weird configuration things inside of webpack or the taskrunner-du-jour.
But, sadly, it feels like openly selling yourself as a consultant in these technologies would be a form of sabotage and limit your opportunities considerably.
I've just had an idea for branding myself: artisinal, vintage web development using traditional jQuery / Django. :)
Regarding the discussion Micro-Service vs Monoliths. I agree that a monoliths gets you started quicker. But it also asks a lot of discipline from the programmers. E.g. 'stick to your domain boundaries', 'Don't take that shortcut of direct db access because business needed the feature yesterday', etc. Otherwise you'll have big troubles splitting it up later on. [2].
I REALLY REALLY REALLY like that micro-services make your boundaries explicit and enforce you to write contractual APIs aka Interfaces. Much more than all the promises of scalability etc.
[1] https://github.com/MarkusPfundstein/microservice-service-dis... [2] https://martinfowler.com/bliki/MonolithFirst.html
I am still coming back to projects sometimes where I didn't do this and I hate every minute hacking on them -.- 'Wish I would have just used React or whatever' are often my thoughts then :-)
From what you just said they're running for, at most, a few thousand people.
In terms of loads/numbers/etc. that's child's play and definitely not "huge applications". The kind of decisions he's talking about are for things with thousands of concurrent users per second, not per day.
That kind of stuff could be dealt with a single desktop computer running PHP and mysql. And you definitely don't need microservices.
In my experience, having worked in both enterprise and consumer startups, enterprise is shallow but broad with little need for any of the complicated stuff and more need to make the code really simple, obvious and uncomplex because it ends up dealing with so many different problems, while consumer scale is where you start needing to get a bit fancy purely because of scale, but it only deals with a couple of problems.
With huge applications, I mean 10s of thousands of lines of code with features added on a daily basis by multiple developers.
What both have in common is that they started us as seemingly small 'throwaway tools' but grew into business scale applications that serve now a core purpose.
Btw, who said I didn't use MySQL and PHP ? :D
Introducing microservices into a small code base feels like it would be counter-productive. It adds a ton of unnecessary complexity to a tiny code base.
You don't want contractual APIs for code like that, as it grows the contracts are going to be constantly breaking as new features are added and the only people who care are the other, internal, developers.
If you used a statically typed language, in a monolith it would tell you immediately that it had happened as soon as you did your sync (which should be happening multiple times a day for everyone). Better still, the other developer would have had to deal with it, the only code you'd need to worry about is the new code you added, and again, your check in would break the build.
Code how you want, but my mind boggles at people doing microservices for tiny code bases. Much better to have a monolith until you get into the million of lines.
I am just thankful I work on statically typed monoliths where my tools just deal with it and I don't have to spend time setting up and debugging microservices instead of doing actual work.
Thanks for telling me what I want :-) I also worked on statically typed monoliths (.Net)! I also worked on micro service systems (>70 services, 2 years of work) written in NodeJs.
It all has its pros and cons.
When I buy a car I’m buying the benefit of it, which is convenient transportation. I don’t really think that I’m buying a drive train, engine, steel body, airbags and whatnot.
Some companies have GitLab workflows that also deploy successfull builds automatically, checks are there problems in that deploy, and rollbacks automatically when needed: https://twit.tv/shows/floss-weekly/episodes/473?autostart=fa...
Such workflows could also be made with for example: - Huginn https://github.com/huginn/huginn - Flogo http://www.flogo.io
And that is the trick — make the client retry with the exponential backoff. Document it as the expected behavior when that event arises. And for our traffic patterns this is acceptable.
It was spectacular 10 years ago, but now it's pretty much useless to me. Most everything either shouldn't be done in javascript or has a native replacement – at least with polyfills and Babel that I need for all development. I would love to remove it, but it would take far too long and provide little customer benefit (remove the library download), so it's only removed when something is refactored.
And Web Components are starting to destroy jQuery Plugins.
If I look at the number of open source 3rd party js libs that support it, they are around 180k LOC.
Eventually, I do see a project that ports over the entire js code over to ES6 and Vue.
When it becomes very much not faster is when you have a bunch of jQuery poorly (or "customly") organized and someone else has to wade back through.
Vue is awesome though, really liking it. Sometimes I use Vue and jQuery together to take advantage of jQuery plugins. Does this make me a bad person?
My end users don't care! YMMV