logoalt Hacker News

Gualdrapo • today at 8:06 PM • 5 replies • view on HN

I wonder if people use jQuery on their new projects. Vanilla JS has come a long way since jQuery was king.


Replies

elondaits • today at 8:09 PM

Yes. I did not so long ago. Vanilla JS is fine in term of features, but if you consider jQuery code idiomatic, then it's much more compact and readable for some development patterns.

bryanlarsen • today at 8:33 PM

I'd use jQuery if IE11 support was a requirement. It's been a long time since I've seen that as a requirement, but IE11 was the last Internet Explorer before it got replaced by Edge. I wouldn't be surprised if there were hold-outs out there still using it...

➕ show 1 reply
hirvi74 • today at 8:13 PM

I do when absolutely necessary, which is becoming rarer as Vanilla JS improves, like you stated. One of my coworkers is still using it on all new projects though. My employer has avoided the whole SPA scene for better or worse.

pjmlp • today at 8:36 PM

It is still less verbose than the DOM navigation APIs that landed on the browsers.

petre • today at 9:04 PM

Go ahead, use document.querySelector. Why? Because chaining and a bunch of other stuff and not bothering to check if querySelector actually got anything every single time. Vanilla JS is like bringing a knife to a gun fight.