Live data from Hacker News

You might not need jQuery (2014)

youmightnotneedjquery.com

21–30 of 241 posts

Re: You might not need jQuery (2014)

#21

Earlier quoted context omitted.

I think a lot of the initial appeal around jQuery was that it made querying and manipulating the DOM simple. Much of its features have been replaced by broadly-available APIs like Document.querySelector and Element.classList. Loading the entirety of jQuery just to access some of the remaining features just means you're loading JavaScript that you aren't going to use. I miss relying on jQuery because it's familiar and…

I thought a big part of the initial sales pitch was not having to deal with cross-browser compatibility issues.

[deleted]

Re: You might not need jQuery (2014)

#22
The biggest benefit of jQuery is concealing some levels of complexity that are somewhat hard to grasp.

The biggest flaw of jQuery is concealing some levels of complexity that are absolutely vital to grasp.

Re: You might not need jQuery (2014)

#23
Having used react and redux for several years now, I'm a bit burnt out on how bloated and silly the entire front end has become. If I could decide for myself, I probably would use raw DOM or jQuery at this point.

Re: You might not need jQuery (2014)

#24

It's ironic that there's probably no bigger sales pitch for jQuery than this site. In every single example, the jQuery version is basically one or two lines of code, versus 10-15 lines for the alternative. (and the jQ version seems significantly easier on the eyes as well.) Also, jQuery supports promises and has for quite a while. This page hasn't aged well. I've come full circle and am now using jQuery again.

I haven't gone this far, but I still like lodash. It feels like it fleshes out a too-light core JS lib.

Re: You might not need jQuery (2014)

#26
post #23

Having used react and redux for several years now, I'm a bit burnt out on how bloated and silly the entire front end has become. If I could decide for myself, I probably would use raw DOM or jQuery at this point.

There really isn’t a good middle ground yet.

Look at svelte if you haven’t.

Re: You might not need jQuery (2014)

#27
post #8

Earlier quoted context omitted.

This comment is a great example of what I call "lines of code mindset" which is form of tip of the iceberg mentality, where programmers optimize for simplicity only the code they see. Is saving 10-15 lines worth it if you need an 86.1 Kb vendor dependency? Hidden complexity you don't control is the most expensive kind I think.

> Hidden complexity you don't control is the most expensive kind I think. That's called encapsulation. :) Seriously, encapsulating complexity is the foundation of most programming paradigms.

Actually, it's called abstraction, as a technical point.

Re: You might not need jQuery (2014)

#28

Earlier quoted context omitted.

jQuery, minified and Gzipped is 30.4kb. That's completely unacceptable for my needs. This is why folks complain about bloat.

Are you being sarcastic? But, either way, it really depends. If you are writing a large application and jQuery saves thousands of lines of boilerplate, then it's totally worth it. For a tiny library (which is what this page is targeted at), then it's probably overkill and you should learn how to do it manually with pure JS. Both can be true at the same time.

He might not be being sarcastic, servers are expensive and every little slice helps, though I think the cdn aspect changes this question somewhat.

Re: You might not need jQuery (2014)

#29
post #23

Having used react and redux for several years now, I'm a bit burnt out on how bloated and silly the entire front end has become. If I could decide for myself, I probably would use raw DOM or jQuery at this point.

This might be interesting to you: https://github.com/alpinejs/alpine/

Re: You might not need jQuery (2014)

#30

Someone should make a youmightnotneedspringboot.com

I'm less interested in what people are running their backend on because that tends not to be where performance issues with sites lie.

WHAT? That's exactly where performance issues come from. Chances that the client side code is so poor the site doesn't load is very low.
Post reply on HN