> Pages like You might not need jQuery try to sell the idea that it’s easy to ditch jQuery, but the very first example is a good reason to use jQuery: one line of trivial jQuery code gets replaced with 10 lines of vanilla JS code! There's no such thing as one line of jQuery, it's 10K lines before you add your one line to do that one thing that 10 lines of vanilla JS code can do.
Why I'm still using jQuery
141–150 of 246 posts
Re: Why I'm still using jQuery
#142Earlier quoted context omitted.
> I still believe that they're more difficult to develop than adding JS on top of classic HTML (not saying they're worse, but certainly I don't find them easier). You're right, I should have been clearer. Emphasis on develop and maintain . If you're just building a near-static site with, say, some slideshow that needs basic JS then I'd use jQuery too. I'm sure there's a bazillion plugins that already do what I want a…
> You're right, I should have been clearer. Emphasis on develop and maintain. Did you ever think that you might want to put the user experience first? Look at YouTube with their great SPA. If I'm on mobile and not using a flagship phone with 3gb of ram, it's just great: I scroll through my search results which are these idiotic incrementally loading page, then I select a video, watch it and want to go back. Surprise!…
You're blaming SPA but as usual it's just people not caring about polishing application UX.
Re: Why I'm still using jQuery
#143I'm done with SPAs and the whole modern front end workflow. If there was a solid benefit to a SPA it would make sense to endure all the complex development, ever changing ecosystem, etc, but in the vast majority of cases there is no benefit. Users don't care about SPAs, some of the most successful biggest websites are not SPAs (Amazon, Ebay, Wikipedia, etc).
A static site generator like Jekyll with some sprinkled JS offers a much better experience. When that is not enough a good old server side rendered app with sprinkled JS is the next step I will consider.
There are some perfectly valid use cases for SPAs but those are rare.
And don't get me started on libraries/frameworks figuring it out as they go along. jQuery has had a stable API and methodology like forever. React has made major changes in only 5 years. From createElement, to JSX, to classes, to stateless components, to hooks, and only god knows what they will come up with next year.
Re: Why I'm still using jQuery
#144"You may not need SPAs" is just another "considered harmful" series of cliches fishing for upvotes.
These folks always talk about making the site accessible for everyone by: taking out fancy scripts, images, colors, animations, etcetera; but their sites are the ones that get no traffic, nobody wants to read, nobody wants to use, all that.
Maybe our customers don't want stupid simple shit, on account that it's stupid simple. Even the hypotethical 3rd world user, which everyone loves to cry big fake croc tears about, is using Whatsapp, is using Facebook, Instagram, etcetera.
The only place people know anything about NoScript, let alone convince them, is here. And I hate HH It's one of the worst-looking, hardest-touse to use sites. It is certainly not a paragon of good design, no matter what the ancient neckbeards say.
Just look at the size of those voting arrows. It's ridiculous. How many of yall give downvotes by accident? And all this price to pay for nostalgia?
P.S: This whole "most sites don't need an SPA" angle is just plain bullshit. Anyone with real experience in our industry knows that.
Re: Why I'm still using jQuery
#145If you then don't find the relevant information in the first second, congratulations, you just made a page which is useless to people with old Screen-readers.
I may be old fashioned in this regard, but i only see JS as a Add-on to the text you want to get out and only use it to add functionality which would be impossible with html and css alone. e.G. to give a hint when there are new articles to read, or when a article has changed.
Comment sections for example don't require JS at all, but you can use JS to make it needless to reload the page after you send that HTML Form.
Re: Why I'm still using jQuery
#146Earlier quoted context omitted.
> Had they learned vanilla javascript first Vanilla Javascript has nothing to do with DOM APIs. DOM APIs is just another interface/library/abstraction that you need to learn after you've learned JS. > If you learn jQuery today, you're not learning core JavaScript DOM APIs are not core Javascript.
You are right, but it's kind of beside the point given the context is web libraries. jQuery is built on top of the DOM API, so it's a library on top of an abstraction. It is just as simple to learn, so why not learn the core abstraction, with which all other DOM based abstractions are built from? jQuery will eventually go away while the DOM API is part of the web's core stack. Maybe it changes over time, but there wi…
jQuery, or something like, it will be around "forever" because a core problem it solves is inherent to the DOM API.
("forever" actually means for the foreseeable future, projecting out where trends will take us in the future.)
The core problem is, there is no DOM API... there's a collection of DOM APIs which overlap (a lot) but that have various differences from browser to browser and from release to release. Just as importantly to software development, the wholly stable parts aren't really a single API either, but a group of APIs with a lot of duplication and variation in the patterns and idioms used.
For good software of any complexity, you're going to want to build as much of your code as possible in terms of a simple, concise, consistent, stable foundation and the DOM API is not those things. It doesn't have to be jQuery.
(BTW, I'm mainly talking about application-level code here. For utilities, plugins or other lighter-weight libraries, NOT requiring a separate library is a significant advantage. And your DOM access may be limited and well-defined so that a vanilla approach isn't burdensome.)
Re: Why I'm still using jQuery
#147Simply said, jQuery is still the best plug-n-play solution for most small projects.
The numbers are not against jQuery. There's no real gains to skipping it. At 27.77 KB (Minified and Zopflinated file size) it's not as if it's weighting down your pages. On the rare occasions I actually come across something done faster in raw JavaScript (often because jQuery has some heavier polyfills), I simply use the raw JavaScript in my jQuery project.
Re: Why I'm still using jQuery
#148> In my experience server-side generated templates lightly sprinkled with “progressive enhancement”-style JavaScript are still the best way to do that. Those apps are easier to develop, tend to be faster, tend to have fewer bugs, and your laptop’s fan won’t wake the neighbours. Thanks for that part. Really. A heartfelt thank you. Every time I see another "hey, I only want to show you text, but for some reason I thoug…
Re: Why I'm still using jQuery
#149Earlier quoted context omitted.
> You're right, I should have been clearer. Emphasis on develop and maintain. Did you ever think that you might want to put the user experience first? Look at YouTube with their great SPA. If I'm on mobile and not using a flagship phone with 3gb of ram, it's just great: I scroll through my search results which are these idiotic incrementally loading page, then I select a video, watch it and want to go back. Surprise!…
This kind of terrible state management is super widespread and really annoying. I agree that lots of folks seem to have have spent the last few years thinking more about their build chain and tooling than about basic UX.
This might be the best summary of how I feel about web development that I've read in a fair while.
Re: Why I'm still using jQuery
#150Earlier quoted context omitted.
Not really a struggle, but why would you want to type ten lines when two will do?
There are a lot of answers to that question, but they all summarize down to: you are the developer not the user . * Perhaps those 10 lines execute faster * Perhaps those 10 lines are exactly 10 lines, where jQuery is 2 lines plus a 65k library * Perhaps those 10 lines work equally in multiple environments (node, deno, electron, browser) where jQuery does not. * Perhaps those 10 lines sit behind a custom abstraction t…
Heh, and here we come full circle. I remember back when the whole point of jQuery was to handle the different underlying JS implementations for you.