Vanilla JS is now faster and easier than most of jQuery, but I wouldn't knock anyone for using jQuery if it saves them time because they know it.
If some reader hasn't taken a look at what you can do with vanilla JS, go ahead and google the next thing you attempt to call jQuery for, you might save yourself some kilobytes of dependencies and complexity.
I recently used jQuery UI to get a calendar up on a page, the client is happy, and I didn't have to burn a week of my life fucking around with newfangled garbage for that.
The problem with not using jquery is that it still takes a lot more code to get the same thing done, and I still need to worry about cross-browser compatibility myself. The amount of extra code keeps shrinking, and browsers are getting closer together but it's still not as easy.
Just don't build complex UIs with jquery. But plain old HTML with a dash of jquery is just really easy to work with.
That's what we're saying though: that used to be true, it's not now (at least in my experience so far). JS does a lot by default that used to require jQuery. It's surprising and refreshing.
I still hate JavaScript and use it as rarely as possible, but even I of all people will concede that modern JavaScript has improved to the point where it can now stand alone.
Give me an example of something that takes a lot more code without jQuery? Maybe we'll both learn something by comparison?
I agree that JavaScript got much better but I still feel like updating the DOM by hand is still too cumbersome to forego using a library or a framework.
Whenever I write an app with just regular JavaScript I find that I always end up creating an immature library for DOM manipulation.
I'm helping my girlfriend build her Chinese teaching business, pure service-based (I like to call it a Service as a Service business :P). A paid website template, Canva subscription, and a virtual assistant gets you ridiculously, ridiculously far. Even PHP would be overkill at this point.
My day job is working for a company that sells video call infrastructure. We needed a bit more than PHP for that :)
There is so much bloat in the web dev world it's ridiculous. Almost all tools out there meant to make things easier just complicate things further. The other day I was looking for a basic html template and all had tens if not hundreds of dependencies and setting them all up took longer than actually just implementing a basic template myself.
> Most devs out there use overengineered and overcomplicated frameworks/tooling in the name of a perceived short-term boost in developer speed.
There's also the whole "resume driven development" trend, where if you want to be hireable, you more or less need to be able to use whatever is popular, for reasons outside of anyone's individual control. People's opinions about what they need will vary a whole bunch, from person to person, often based on what they're familiar with and what has or hasn't worked in the past.
For example, in my case that might be:
- Front end: something like Vue if you're doing SPA (subjectively: good to decouple front end from back end), React and Angular might be overkill with their complexity, maybe even JS instead of TS; throw in ready-made components with something like PrimeVue
- Back end: whatever boring language/runtime/platform you're familiar with and that let's you get things done, like PHP, Node, Python, Ruby, Java or C#; ideally something that has been around for a long time and has mature frameworks/libraries
- Communication: most likely RESTful APIs, because of how abundant they are and how good the tooling is; GraphQL never felt necessary for my workloads, gRPC felt a bit less easy to work with
- Storage: a traditional RDBMS like MySQL/MariaDB or PostgreSQL will take you really far; sometimes you can consider specialized solutions, like Redis, RabbitMQ, MinIO or even MongoDB, but only when you need to and even then something like Kafka might be too complicated
- Runtimes: OCI containers, with lightweight orchestration, I'm yet to run into circumstances where Docker Swarm or even Hashicorp Nomad aren't enough; K3s is great but many of the Kubernetes distros out there will be too complex, you can even do your own ingress with Nginx/Apache/Caddy and it's going to be really simple and discoverable (just a web server container on 80/443)
- Servers: if you go with OCI, you will be able to use even any regular VPS provider, get something like Ubuntu LTS, add unattended upgrades, maybe throw some Ansible playbooks into the mix and you're good
Why would I personally opt for a server running containers instead of just regular shared hosting with PHP?
Well, I've seen plenty of projects backed by cPanel and deciphering how sites are structured across the storage in the account has been a mess more often than not, migrating sites to different hosting has been problematic, performance has been challenging (a single bad SQL query slowing down 5 other sites), getting a local version up and running has been problematic, managing runtime versions and PHP extensions, and resource limits has been an issue. PHP frameworks like Laravel are more than okay (even something like Slim), but running PHP without containers is asking for issues, just a little bit worse than Java apps that don't package Tomcat inside of them.
At the end of the day, use whatever lets you iterate reasonably quickly - both now and in 6 months when you need to pick up the project again to make some further changes, and deploy them, or do some debugging.
Not all, but php is great. Using curl to talk to external APIs is so easy and then use json_decode and setcookie - all easy to toss objects and data around, readable, immediate.
Yes JS has caught up mostly, but jquery... the way it looks when scanning my code is more symmetrical. Jquery paints a better "shape" representing the output. Speed reading the same code over and over trying to squeeze that new feature in, I need to snap-see what things are doing and jquery makes that "snap" faster for me.
The problem is we use the same platform, the web, for real-time applications, games, CRUD, static blogs, and so on. It’s a flexible platform and many tools have niches in these different scopes & some _are_ quite large. But a lot of folks misdiagnose the scope & size of their projects choosing the wrong tool. Some of this is fueled by wanting to build résumés or try new hotness or just overcorrecting an ancient jQuery spaghetti that should have been a web app. Suggesting jQ+PHP is the only thing you need is naïve: both in that there isn’t a silver-bullet software architecture for all projects and that often times even jQ+PHP is overkill when a static generator could suffice.
I don't really get why someone would use JQuery, still. My experience with fixing old codebases is JQuery is difficult to write in a way that prevents bugs when moving html elements. That seems like a complete nonstarter. Selectors are extremely brittle. You're either selecting by ID or you're traversing up and down the DOM and hoping that never changes.
I'm aware this is how people did it for a long time, but we surely have better "simple" tools now. Maybe Svelte, Hyperscript, etc
And yet good luck landing an interview if you lack years of experience with React, Angular, Vue, Bootstrap, Typescript, Node, et cetera ad nauseum. Dependency hell is now the foyer.
18 comments
[ 2.4 ms ] story [ 58.9 ms ] threadAnd add Ansible. Super low learning curve to get a server up and running.
If some reader hasn't taken a look at what you can do with vanilla JS, go ahead and google the next thing you attempt to call jQuery for, you might save yourself some kilobytes of dependencies and complexity.
I recently used jQuery UI to get a calendar up on a page, the client is happy, and I didn't have to burn a week of my life fucking around with newfangled garbage for that.
Just don't build complex UIs with jquery. But plain old HTML with a dash of jquery is just really easy to work with.
I still hate JavaScript and use it as rarely as possible, but even I of all people will concede that modern JavaScript has improved to the point where it can now stand alone.
Give me an example of something that takes a lot more code without jQuery? Maybe we'll both learn something by comparison?
Whenever I write an app with just regular JavaScript I find that I always end up creating an immature library for DOM manipulation.
I'm helping my girlfriend build her Chinese teaching business, pure service-based (I like to call it a Service as a Service business :P). A paid website template, Canva subscription, and a virtual assistant gets you ridiculously, ridiculously far. Even PHP would be overkill at this point.
My day job is working for a company that sells video call infrastructure. We needed a bit more than PHP for that :)
Most devs out there use overengineered and overcomplicated frameworks/tooling in the name of a perceived short-term boost in developer speed.
There's also the whole "resume driven development" trend, where if you want to be hireable, you more or less need to be able to use whatever is popular, for reasons outside of anyone's individual control. People's opinions about what they need will vary a whole bunch, from person to person, often based on what they're familiar with and what has or hasn't worked in the past.
For example, in my case that might be:
Why would I personally opt for a server running containers instead of just regular shared hosting with PHP?Well, I've seen plenty of projects backed by cPanel and deciphering how sites are structured across the storage in the account has been a mess more often than not, migrating sites to different hosting has been problematic, performance has been challenging (a single bad SQL query slowing down 5 other sites), getting a local version up and running has been problematic, managing runtime versions and PHP extensions, and resource limits has been an issue. PHP frameworks like Laravel are more than okay (even something like Slim), but running PHP without containers is asking for issues, just a little bit worse than Java apps that don't package Tomcat inside of them.
At the end of the day, use whatever lets you iterate reasonably quickly - both now and in 6 months when you need to pick up the project again to make some further changes, and deploy them, or do some debugging.
Yes JS has caught up mostly, but jquery... the way it looks when scanning my code is more symmetrical. Jquery paints a better "shape" representing the output. Speed reading the same code over and over trying to squeeze that new feature in, I need to snap-see what things are doing and jquery makes that "snap" faster for me.
I'm aware this is how people did it for a long time, but we surely have better "simple" tools now. Maybe Svelte, Hyperscript, etc