Hacker Newsnew | past | comments | ask | show | jobs | submit | cptrp2101's commentslogin

lol. Montreal would like to have a word.


You're bang on here. Why import an entire library when once polyfill and native features will serve you nicely.


I had a big post but deleted it all. I can more concisely say this:

The people here saying they still use it have so far demonstrated what I always say. If you're using jQuery, it's time to go back and relearn javascript. Most people should REALLY research the querySelector and querySelectorAll DOM methods.

I've always felt that jQuery encourages you to let your skills stagnate and you don't learn what your code is actually doing. Learn what the current spec has to offer. You don't need another dep just to target dom nodes ffs.


I disagree, jQuery is still nice for some complicate dom manipulations and still simplify it a lot. Of course I'm not saying you can't do that without it, but saying if you use jQuery you doesn't know JS doesn't make sense.


For new projects I agree. Go jQuery-less.

But for existing projects that still work well and for which there is no reason or gain from updating the code and, for which, time and money would be spent for what is really a lateral move, I think it's fine to leave it as is.

And there are many projects like this where the JavaScript barely changes, jQuery is holding it in place and nicely and there's hardly any technical debt. There's no incentive to spend the money and time. Making a developer feel better is not really worth it in these situations unless they'd like to work for free.


I agree. No need to go into something that exists and do a big refactor to pull it out. I'm advocating for not adding it to things you start now.


> If you're using jQuery, it's time to go back and relearn javascript.

I've roughly as fluent in vanilla as I was in jQuery and I still think jQuery was a nicer, more elegant, more humane API to the DOM.


I've never really learned javascript in the first place - every time I try to learn I get caught up in a mix of versions of javascript(or ecmascript?), build systems, and just use "..." (coffeescript(lol), typescript, some node build system magic)

I build (barely) working websites with jquery and html and css though, having the "this is the one way jquery would do this and ignore all that other crap" value is high to me for that very reason - I work mostly on databases and having to learn the current spec every 2 years or whatever you web sickos are doing suuuuuuucks.


It´s been a while since I coded some front-end. What about issues with different browser implementations? jQuery used to handle those discrepancies.


> Most people should REALLY research the querySelector and querySelectorAll DOM methods.

Query selectors are like slow motion drowning in syrup. They are so astonishingly slow. They are also limited in what they can do.

Just learn the DOM. It can be learned in a single afternoon but for some reason people will fight you to death on this and then stake their careers on it like a heroic battle that nobody cares about.


Have fun when your page randomly gets visited by IE7 running behind some ancient corporate firewall.


i couldn't agree more!


If you're still using jQuery, maybe you don't enjoy web development, and you should do something you enjoy instead.


https://developer.mozilla.org/en-US/docs/Web/API/Document/qu...

Does the same as the $ query but native in every browser in IE9+ and gives you a native node. Also more performant than getElementBy<whatever> methods.


document.querySelector(selector) is more typing and more visual clutter on the editor screen.

jQuery is elegant, concise, and was designed by a genius. The "modern" methods are ugly, verbose, and were designed by a committee.


These are really cool. As someone who mostly writes code for web, this seems like a fun way to learn a new stack.


Absolutely! I'm also a web person and I got into embedded as a hobby using ESP8266 w/ the Arduino IDE (The ESP32 is a newer, better ESP8266).

I cannot recommend it enough. I've built some neat stuff, like this device[0] for triggering my door buzzer over the web.

[0] - https://jeremypoole.ca/posts/put-your-door-on-the-internet/


I switched from momment to dayjs in a project I finished a couple months ago and the massive reduction in entry size was remarkable. I really like dayjs.


I think, as with anything else, it's important we understand the tools we are using. I started with jQuery and the problem was (like many others) I learned it before I actually learned javascript. I've since backtracked and dug into vanilla JS so I can have a better understanding of what my code does.

Since then, I haven't found a situation where I miss jQuery. However, I don't damn anyone who uses it (beyond jokey arguments with the wordpress dev on my team).

It seems like this opinion won't fit in well here, but at this point I find vanilla more than enough for anything where Vue or React will be overkill. However, I'm obviously biased as a front-end app dev and am open to seeing what other people have to say.

I'm not sure what to think about the server side vs. client side comments in the article since that fall outside my area of knowledge.


You will soon come back to using jQuery again thinking what the point of just saving 30KB by letting your code become longer.


Doubtful - 30 kB minified & gzipped is a lot of code, and the fact that jQuery doesn't help with your code organization/keeping code DRY much is a huge negative.


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

Search: