Hacker News new | ask | show | jobs
by jaydenseric 2939 days ago
Unless you were doing custom jQuery builds per project (which no-one was), it was always bad. People would routinely drop in the 35kb lib and only use 3-4 functions.
3 comments

That's not really a problem with jQuery, that's a problem with the way people were using it.

Also, a slow loading JS lib wasn't as much of an issue 5-7 years ago when jQuery was really in its heyday. Web pages were simpler and more information based back then and it was usually a requirement that they be useable without javascript. Since you are (should be) loading jQuery at the end of the page (or asynchronously) the page should render just fine without jQuery and probably would have been loaded by the time any user interaction would have happened.

Also, since users were on computers (mobile wasn't really a thing) and data usage wasn't a limiting factor (most plans were unlimited), loading extra data didn't really matter that much.

Yeah, jQuery had extra functions that you didn't need, but it didn't really hurt much at the time and there wasn't really a better option.

It still doesn't hurt. Less than 300k of a cachable library isn't a big deal for mobile data, and jQuery has never (in any example I know pf at least) been the reason a mobile page is slow. Sites like the default mobile reddit manage to be absolutely atrocious without it (10+ seconds to load anything even on wifi), yet lots of sites with it are completely fine on any smartphone in current use (such as the same phone mobile reddit takes 10 seconds to load on because it's using some awful ajax setup - seriously, they had perfection with .compact and just abandoned it for this crime against humanity).
> Also, a slow loading JS lib wasn't as much of an issue 5-7 years ago when jQuery was really in its heyday.

Not to mention it was recommended to point your "src=" to one of the common cdns, so it would likely already be in the user's cache from some other website that used the same jquery version.

I wish typical webpages would only pull 35kb of resources.
I wouldn't say jquery was bad. It was really a nice API with interesting innards. Easy to abuse, of course, it was too popular not to end up being the first thing people try to have 'modern' websites.