7 ms·
I'm consistently surprised by the commenters on HN who seem to think jQuery is just a DOM selection library, when in fact it is a widely supported, incredibly s
by wkirby 3y ago
I'm consistently surprised by the commenters on HN who seem to think jQuery is just a DOM selection library, when in fact it is a widely supported, incredibly stable tool set for (yes) DOM selection, but also attribute manipulation, Ajax requests, event handling, animation, and general utility functions. What's more, where there _is_ native functionality that replaces jQuery, the API is never as fluent.
For work that needs a little enhancement on top of server-side HTML, but not a full-blown JS UI framework, jQuery is a small price to pay for a stable, reliable, and cross-browser compatible dependency.
- genocidicbunny 3y agoI don't think it's that surprising given the demographics of HN posters that I've observed. Many will immediately reach for the big JS framework du jour when they need anything more than a little DOM selection stuff, because that's what they've always done.
- erhaetherth 3y agoThere's 2 types of web pages. Websites and web apps. If you're building a web app, you're going to want a framework that isn't going to fall apart the second things start getting complicated. If you're making a little marketing website, sure, sprinkle some jQuery on there and call it a day. Probably better for performance and SEO unless you want to spend 10x as long micro-optimizing your SSR. Point is, there's different use-cases.
- genocidicbunny 3y agoOkay, what part of what I said are you trying to refute or educate me on? There's a large proportion of posters on HN who spend their days building web apps. They are very likely to stick to using what they know, even when building web sites. If you spend your days working as a welder, and suddenly need to build a box for some reason, you're probably not going to be breaking out the fine wood joinery tools. You're probably going to take some sheet steel and weld up a box and move on to whatever else you have to do. It's not a problem, it's not a fault, it just how things are.
- hnfong 3y ago> Okay, what part of what I said are you trying to refute or educate me on? Not the GP, but that's why, when applicable, I try to prefix my replies with a variant of "I agree, and btw..."
- austin-cheney 3y agoIt’s all the same. The difference is not in the product but in the developer’s perception of the product. The code and the user don’t notice the difference, just the developer in the middle. There are those who can dynamically put text on screen and those who need just a little help to dynamically put text on screen.
- bradly 3y ago> the user don’t notice the difference Users do notice the difference is large JS framework driven applications.
- mostlysimilar 3y agoYeah, they notice how slow and janky they are, and how often they're staring at empty gray boxes while things load.
- DrSiemer 3y agoA few years ago I dropped jQuery for plain vanilla js and I've never looked back. Native js has everything jQuery has, except for the pile of often poorly maintained half baked "plugins", that usually only do what they want to do and not much else. Yes, the vanilla selectors are more verbose, but any half decent code editor will make them just as fast to type. I don't mean to be penantic, but I don't really understand why so many people still use jQuery at all. https://youmightnotneedjquery.com/ https://youmightnotneedjquery.com/
- gonational 3y agoLMFAO every example of "modern" looks like a course in how not to design an API, etc. The jQuery examples are so clean and expressive. Imagine landing on a page like that and thinking, "hey, that 'modern' option looks good." You'll end up with 28KB (jQuery gzipped size) of just extra syntax before you're done with your app, not to mention the additional 160 hours of work. You'll likely be adding 6-700KB of React and its ilk anyway (I see it in every project now).
- austin-cheney 3y ago[flagged]
- cpill 3y agooh the arrogance! love it this is why I read the comments on hacker news before (or mostly in place of) the article :P
- austin-cheney 3y ago[flagged]
- subtra3t 3y agoJust in case this comment gets flagged, here is the original text: --- Sigh. There are people who cannot program and fortunately for those people there is jQuery. Writing any kind of UI in vanilla JS is trivial and even more so with TypeScript. If that takes you a 160 hours to complete you are not the guy to be doing that work. I could pay my pest control guy to figure it out. Maybe it might take him 160 hours. JQuery used to make sense back in the days of IE, especially before IE9, and your team was green. Even then most cross browser issues were in CSS, not JS. Those days are long gone.
- jazzcrab 3y ago> commenters on HN who seem to think jQuery is just a DOM selection library proceeds to name selection and native functions
- wkirby 3y ago> just
- 5350-uiop-1130 3y agoyes and far easier to drop jq into a project. no need for build tools and all headache. (i know you do that with react but its not comparable features).
- robertoandred 3y agoYou don’t run your JS through babel or minification?
- 5350-uiop-1130 3y agowhy would I? for a small project those efficiencies wont make a difference on my $20 godaddy hosting account. i dont want some tool or process getting in my way. if i have a problem then i will look for a solution.
- mablopoule 3y agoThis, so much. I do like SPA also, but some of the nicest projects I've worked with could be run locally by launching `python3 -m http.server 8008' on the right folder. I'm happier when I can do something without a processing step, or the need for a package.json. Need a third-party script? Vendor it, and never have to worry about supply-chain attacks.
- robertoandred 3y agoFor browser compatibility?