Hacker News new | past | comments | ask | show | jobs | submit login

I don't like jQuery -- I mean I use it but it doesn't occupy enough brain space to even have a strong opinion on it either way. If I took jQuery out then I'd have to care more because would need to re-implement all the pieces of jQuery that my projects already use. Is that going to be 280k worth? No. Is going to be a couple of one-liners? No, because jQuery hides a lot of complexity under it's relatively simple API that take a lot of JavaScript to reproduce.

It's not crazy that to accomplish what jQuery accomplishes without jQuery you're going to need almost the same amount of code as jQuery. It's not re-implementing the DOM -- it's a pretty thin but broad wrapper. If you don't need something, remove it.

https://github.com/jquery/jquery#how-to-build-your-own-jquer...

The whole point of using a library is to outsource the problem somewhere else.




Alright, we seem to be talking past each other. Maybe that's the sign this is not a productive discussion.

I'm not calling jQuery is bloated or difficult to read, nor I am telling anyone they should count bytes.

> Is going to be a couple of one-liners? No, because jQuery hides a lot of complexity under it's relatively simple API that take a lot of JavaScript to reproduce. > It's not crazy that to accomplish what jQuery accomplishes without jQuery you're going to need almost the same amount of code as jQuery

Once again, that's my whole point.

What I'm saying is that jQuery isn't a 100-line library. The whole of jQuery is not being trivially reimplemented at several places. Projects reimplementing portions of jQuery functionality (a la youmightnotneedjquery.com) are usually only reimplementing very very few things, and are leaving out lots of stuff. Different projects have different needs, some people don't need the whole library, some do, others don't care. That's it.


You might be right about the discussion. But I was thinking about this and I think my point comes down to the basic issue of almost every library or big piece of software. Nobody uses 100% of any big library. Nobody uses 100% of Microsoft Word. Most people use about 20%. But the problem is everyone uses a different 20% so libraries and software have a lot of features.

The argument against jQuery is thus an argument against libraries in general. Why include any dependency that you only use a small part of? You can always implement anything yourself.

The counting bytes comment is because the web, as a platform, is very size-conscious. Rarely does anyone complain about the size of libc and how, since they only use file functions, that should just call into the Linux kernel directly.

Would we even by having this discussion if you could just tree-shake out all the parts of jQuery that you never use at build time?


> The argument against jQuery is thus an argument against libraries in general.

Then it's a nice thing that I never made any argument against including jQuery or any library in a page or project, nor I'm saying anyone should reimplement it, or even do anything. I'm not talking about those things.

> Would we even by having this discussion

We aren't even having this discussion. Seems like you're having an argument against an imaginary version of me. I'm not saying (or implying) the things you are arguing against.


Your argument is that is that body is going to re-implement all of jQuery with their own helper functions. I got that. It's just not a very interesting point. Was I using hyperbole -- yes. You got me.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: