logoalt Hacker News

smt88 • today at 9:27 PM • 5 replies • view on HN

What’s a use case for jQuery over vanilla JS?

When most code is and will be written by AI, why would I sacrifice performance for syntactic sugar?


Replies

xp84 • today at 10:11 PM

Serious question: On modern hardware how much performance is jQuery actually taking away from you? Compared to the ridiculous overkill factor of using React for simple static pages, a practice I see everywhere now, the time it takes jQuery to parse seems inconsequential.

➕ show 1 reply
nilamo • today at 10:04 PM

Vanilla JS only works with a recent browser. JQuery works with old garbage people never updated.

➕ show 1 reply
reassess_blind • today at 9:56 PM

Valid questions. In jQuery's case it's still so widely used by older codebases that it makes sense to improve and keep maintained. I think it's important to have alternatives in any case. Some people still prefer to write code by hand, and some people prefer jQuery.

mathgeek • today at 9:58 PM

I wouldn't say there are _many_ use cases, but "LLM is writing code in a legacy codebase without heavy refactors" fits your question.

SoftTalker • today at 10:02 PM

Same reason we've always sacrificed performance for syntactic sugar. Readability and maintainability are the big ones. If you trust your AI to get it right, sure I guess that doesn't matter.