3 ms·
Why use JQuery when you can do it in a way that's more ugly, more verbose, less portable, more likely to break?
by grabcocque 10y ago
Why use JQuery when you can do it in a way that's more ugly, more verbose, less portable, more likely to break?
- zepolen 10y agoMostly agree, but there are use cases like performance where it's best to go as low level as possible.
- metalelf0 10y agoThis is exactly what I came here to type. Or, you can take all the vanilla js snippets, wrap them into a shorter notation... and build your own jQuery, just with less portability. I don't get the point of this.
- fiiv 10y agoJQuery is massive and has a lot of functionality. Sometimes this is nice, but sometimes all you need from it is a small part of that whole. I think the point of that link is that if you are looking to build in some simple functionality like hide and show an element when someone clicks a button, then you do not really need to include the whole JQuery library just to do that because then the massive library is not being used and you would be better served to write your own vanilla function. I don't see anything wrong with that. No one is saying that JQuery sucks or that it should die, I think the point is more "use the best tool for the job". You can buy a massive wrench with all kinds of adjustable settings and addons and stuff but if all you ever need is an Alan key, then maybe the little one that comes with your IKEA furniture is actually better and easier to use than that massive wrench.
- drinchev 10y agoNo jQuery actually means: 1. Less dependencies for your JavaScripts 2. Less "magic" behind the scenes 3. Native JS-engine optimisation 4. Switch of though-process ( jQuery, although quite flexible ), makes you think that everything is "string", "array", "object" and sometimes you need the bare Node-element e.g. https://developer.mozilla.org/en-US/docs/Web/API/Element https://developer.mozilla.org/en-US/docs/Web/API/Element
- squeral 10y agoYou can always use TypeScript if you want your code to look prettier and more verbose.