Hacker News new | ask | show | jobs
by steveklabnik 4012 days ago
While this is true, and I love JQuery, there's a significant number of JavaScript programmers who do say that JQuery is bloated and slow and old and you shouldn't use it. http://youmightnotneedjquery.com/ and all that.

Even if it's not actually true (as you've said, it literally is not bloated wrt filesize) people still think it's true.

5 comments

> as you've said, it literally is not bloated wrt filesize

At what point does software become bloated? I disagree that you can approach measuiring size bloat with absolute file size as the only factor.

I rather tend to think of bloat in terms of comparing the solution to other options to achieve the same result. In that sense, if I use jQuery for something that I might as well use plain DOM for, e.g. waiting for the document to load fully before selecting an element to change its content, the level of bloat the additional 30k adds to do the same is ridiculous.

Of course, if you take into account the whole stack of software running from the bare metal up to your browser window, 30k might appear negligible, but when you have a few tabs open with sites that all load hundreds of kilobytes of badly generated CSS, JS frameworks and pictures, and the actual rendering and execution of these consume orders of magnitude more run-time memory, it all adds up.

Kind of a good example of what I mean about how I don't care much about "bloat" anymore... it is my perception that the vast majority of people who fling the term around are not doing so after any sort of careful examination of the system in question and coming to a considered conclusion... it's mostly just an accusation more than anything else. It's not generally a very nice thing to say about a framework, even if you can somehow objectively prove it, it immediately puts the entire conversation on a very hostile footing.
Your link explicitely says "you MIGHT not need jQuery", there's nothing wrong about that, quite often you actually don't need it at all. It doesn't say "never use jQuery"
I find jquery is a good rapid prototyping tool.

If you have limited time use it, but you'll spend more time later trying to remove it again. Building and then marketing a library that lists jquery as a dependency is somewhat of a blight these days, isn't it?

Certain things in jQuery are definitely dated & slow. It has a pretty meh implementation of promises, and the .animate library has pretty bad performance. That's why things like Velocity.js exist.
My point wasn't if jQuery is a bloated library or not, but whether its plugin system caused it to bloat beyond its original purpose.