DEV Community

Joshua Aclan
Joshua Aclan

Posted on

Why not to use JQuery in a JavaScript Framework.

Simple.... You just shouldn't... Its not wrong, but its overkill and at the same time you are under-powering all the features that your Framework has. Okay... Lets, go back in history and try to understand why JQuery was even invented. Back in the old days like the OLD days around 2006 - 2012... JavaScript was not yet a standard and it doesn't support cross browser DOM manipulation. Therefor someone had an Idea to make a JS library to band aid that wound in the world of web development. However, years later that wound would be healed.

JavaScript has become a norm for web browsers and is now standardized across all platforms making JQuery no longer relevant. But hey! I'm not saying developers should stop using JQuery... But I'll warn you. Once you rely on JQuery you will have a harder time adjusting to new frameworks as it doesn't use the common syntax, and it has a rather distinct DOM implementations, after all JQuery is just another JavaScript library...

Back to the topic at hand on Why You shouldn't use JQuery in a framework?

  1. Because it'll just make your app heavy.

  2. Everything JQuery can do, VanillaJS/JS/TypeScript can do better and faster.

  3. It results to a terribly large amount of JavaScript code written.

  4. Frameworks already has its OWN LIBRARY. JUST READ THE DOCS!!!

  5. And finally... JQuery is no longer relevant as mentioned above. It was a band aid solution on a wound that's already healed. It served its purpose...DONE

Alright! Little disclaimer... I'm not telling developers or aspiring developers to not use JQuery at all... But at the same time decide for yourselves whether its still relevant.

jqueryvsjs #react #vue #angular

Top comments (5)

Collapse
 
dormenao profile image
Dorme não!

I was wondering after reading your post, why not use it? Since I still use frameworks like Bootstrap that make compulsory use of JQuery, so I won't waste my code with another library, and my development has always been agile with Bootstrap, so it won't be in 2019 that I will pause, perhaps outright, with jQuery. Ty dev.

Collapse
 
danielrdrigues profile image
Daniel Rodrigues
  1. Because it'll just make your app heavy. R: Majority of the apps doesn't need this performance gain that not using jquery will give.
  2. Everything JQuery can do, VanillaJS/JS/TypeScript can do better and faster. R: Yes, but JQuery has community and thousands other libs that require it, just like react.
  3. It results to a terribly large amount of JavaScript code written. R: Cause it's easy, anyone can write it, it'll depend of the dev experience.

Jquery is simple, and it makes easy to learn and make complex things, frameworks like React and Angular don't think as much as dev experience as Svelte, and that's why people tend to avoid learning React/Angular and try to find something else.

Backend >>>>>>>>>>>>>>>
Frontend is a pain in the ass to develop.

Collapse
 
darkknight profile image
Joshua Aclan

Yeah... Some frameworks still use jquery as part of their library.

Collapse
 
paulyorde profile image
Paul Yorde

Using jQuery to get to the DOM would be as if using Javascript to get to the DOM. 1. Security Risk. 2. Not using Angular mechanisms already in place, i.e - nativeElement. @ViewChild, etc.
see here: indepth.dev/posts/1052/exploring-a...

Collapse
 
darkknight profile image
Joshua Aclan • Edited

Yes exactly, VanillaJS already made built-in methods that are faster than jquerys