5 ms·
Sidenote: Good demonstration that even in 2021 jQuery has its place as the right tool for the job: quickly hacking together a small project.
by pengwing 6y ago
Sidenote: Good demonstration that even in 2021 jQuery has its place as the right tool for the job: quickly hacking together a small project.
- Waterluvian 6y agoWhat parts of jquery in particular?
- XCSme 6y agoI think the Node querySelector $('selector'), attaching event listeners, getting and setting element width/height
- efreak 6y agoMy script template includes some things like `var $=a=>{return document.querySelector(a)}`, `...prototype.evt=(a,b)=>{var e=this.addEventListener(a,b);this.events=this.events||[];this.events.push(e);return e}` and a few other shortcuts. I generally do a mass search and replace to remove them before saving as sometimes i modify them, and conflicting userscripts isn't fun.
- XCSme 6y agoYes, you can replace basic functionality with a few lines of code, but jQuery has more features. For example, jQuery.on('') also works with dynamically created elements. If you want that in vanilla JS you have to write more lines a code, I actually created a library/function for this specific use case: https://github.com/Cristy94/dynamic-listener https://github.com/Cristy94/dynamic-listener
- bjarneh 6y agojquery is still a superb library, such a clever design.
- azinman2 6y agoIt doesn’t tell you what you’re doing or how to do it. It’s just a basic, flexible layer on top of the DOM and doesn’t try to be anything else. There should be more jQueries out there, for all fields.
- whatshisface 6y agojQuery would not be necessary for a project like this, browser APIs are far enough along that many of its features are no longer needed.
- ckuhl 6y agoAnd yet, what is harder to attain and yet more necessary than the knowledge and impetus to implement such a project? It may not be necessary, but the specific tools are't the part that are necessary.
- tomstoms 6y agoIt’s interesting that proponents of a simpler web argue in favor of Jquery for a use case where jquery is in fact very easy to live without. One would almost think dogmatic thinking is involved.
- deleted 6y ago[deleted]
- gaius_baltar 6y ago> It’s interesting that proponents of a simpler web argue in favor of Jquery for a use case where jquery is in fact very easy to live without. One would almost think dogmatic thinking is involved. But to do without it, you will end up rewriting the shortcuts and utility functions that JQuery provides, effectively recreating a project-specific, less-tested and less-supported JQuery.
- tomstoms 6y agoYes agree completely and the same counter argument can be made for more advanced frontend frameworks.
- capableweb 6y agoAre still talking about the jQuery usage in https://joshdata.me/iceberger.html https://joshdata.me/iceberger.html or in general? If the former, then I agree that jQuery was unnecessary here, all API functions used by the author now has appropriate functions shipped natively in the browser runtimes, so using jQuery was actually more work than not (unless the author never used the vanilla API but have used the jQuery API). Otherwise I agree with you in general.
- vmception 6y agojunior devs say dumb things about jQuery because they need to build experience and clout in complicated bloatware fortunately the crypto space is paying well enough these days and all you need is a wallet connect button, without a backend, so devs don't have to deal with this particular elitist bullshit to get hired by someone else anymore its actually questionable whether you need a frontend to make money right now. I've seen plenty of "dutch auctions" with just the liquidity pools: just gotta deploy a smart contract and give instructions on how to form transactions to it.