jQuery has become spaghetti code and you can pretty much do most things these days just using pure vanilla Javascript. No bloated dependencies required :) Learning JavaScript is more beneficial it opens up doors to writing better code and understanding the documentation better. It makes you a better developer in my opinion. jQuery might be easier to use in some cases like doing animation however itβs like using a crutch. Not avoiding writing vanilla JavaScript which will give you far better job prospects down the line.
But let me ask you something. How do you reconcile the fact that jquery is designed to write less and easier JS code, so what would be the logic of preferring JS over jquery, if react and all these frameworks didn't exist?
jQuery has become a bloated and unnecessary library. It is no longer modern and popular amongst programmers. The codebase is antiquated and most of the aspects which made it so appealing years ago can be done using plain javascript. If you know plain javascript then you don't have the overhead of downloading jQuery on every initial load. Adding an additional library just slows down the page load.
It has become quite redundant many of the functions within the code are never used making them dead code. And you also have to constantly update the DOM to the latest version to avoid jQuery exploits. Writing plain javascript means you can use javascript frameworks the learning curve is less compared to someone who uses jQuery.
jQuery is a bit like toy code its hard for good programmers to take it seriously these days.
Okay, I didn't think of this scenario, but I still don't think it's worth it. If you are coding landing page, e-shop or something like that, and you don't need too much javascript then it shouldn't be a problem to write a few more lines of code in order to save 90 thousands bytes for website to load jquery. But if project is a little bit more serious then you shouldn't even think of jquery as there are modern frameworks that will make development almost perfect.
Well 90 KB text gzipped is probably a quarter of it. Depending on where you live, loading time caused by it is negligble.
I always find frontend devs way of thinking to optimization interesting. Shaving few KBs of JavaScript but load dozens of MBs images. Then talking about avoiding dependencies but using node packages that indirectly pull in hundreds of other dependencies. Loading scripts from dozens of HTTP connections, etc.
I'm a software developer who writes about Laravel, JavaScript, Rails, Linux, Docker, WordPress and the tech industry. Follow me on Twitter @tylerlwsmith
jQuery has become spaghetti code and you can pretty much do most things these days just using pure vanilla Javascript. No bloated dependencies required :) Learning JavaScript is more beneficial it opens up doors to writing better code and understanding the documentation better. It makes you a better developer in my opinion. jQuery might be easier to use in some cases like doing animation however itβs like using a crutch. Not avoiding writing vanilla JavaScript which will give you far better job prospects down the line.
i agree.
I think you mean *not avoiding vanilla js
Yep fixed
But let me ask you something. How do you reconcile the fact that jquery is designed to write less and easier JS code, so what would be the logic of preferring JS over jquery, if react and all these frameworks didn't exist?
jQuery has become a bloated and unnecessary library. It is no longer modern and popular amongst programmers. The codebase is antiquated and most of the aspects which made it so appealing years ago can be done using plain javascript. If you know plain javascript then you don't have the overhead of downloading jQuery on every initial load. Adding an additional library just slows down the page load.
It has become quite redundant many of the functions within the code are never used making them dead code. And you also have to constantly update the DOM to the latest version to avoid jQuery exploits. Writing plain javascript means you can use javascript frameworks the learning curve is less compared to someone who uses jQuery.
jQuery is a bit like toy code its hard for good programmers to take it seriously these days.
right i think you're mostly right. However what would you say to the fact that 10 lines of code in JS can be written in 5 with jquery?
For example event handlers have much less code in jquery than in JS
I'm not really sure on what type of event handlers are you talking about? Because I don't think event handlers take less code lines in jquery (js - w3schools.com/js/js_htmldom_eventl..., jquery - w3schools.com/jquery/event_click.asp).
And even if they would take less code, I wouldn't like to write js with such a ugly syntax :D
exactly right here. Click events take half the code with jquery.
Okay, I didn't think of this scenario, but I still don't think it's worth it. If you are coding landing page, e-shop or something like that, and you don't need too much javascript then it shouldn't be a problem to write a few more lines of code in order to save 90 thousands bytes for website to load jquery. But if project is a little bit more serious then you shouldn't even think of jquery as there are modern frameworks that will make development almost perfect.
Well 90 KB text gzipped is probably a quarter of it. Depending on where you live, loading time caused by it is negligble.
I always find frontend devs way of thinking to optimization interesting. Shaving few KBs of JavaScript but load dozens of MBs images. Then talking about avoiding dependencies but using node packages that indirectly pull in hundreds of other dependencies. Loading scripts from dozens of HTTP connections, etc.
Eddie π€£π€£π€£