Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sidenote: Good demonstration that even in 2021 jQuery has its place as the right tool for the job: quickly hacking together a small project.


It 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.


What parts of jquery in particular?


I think the Node querySelector $('selector'), attaching event listeners, getting and setting element width/height


My 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.


Yes, 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


jQuery would not be necessary for a project like this, browser APIs are far enough along that many of its features are no longer needed.


And 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.


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.


> 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.


Are still talking about the jQuery usage in 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.


Yes agree completely and the same counter argument can be made for more advanced frontend frameworks.


jquery is still a superb library, such a clever design.


junior 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.


Was this written by GPT-3?


Yes, it was a deep fake trained by solidity and JS developers making 8-figures of revenue launching purely frontend products.




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

Search: