Pure JavaScript vs. JQuery

Spread the love

Pure JS

The most objective benefit of using pure JavaScript is better performance. Another benefit is the improved understanding of the language you gain from writing pure JS, which you need if you want to be able to do more advanced JS wizardry.

The downside of pure JS is that it is easier to make mistakes or miss something, is less beginner friendly (than jQuery), and can require you to develop more code to accomplish goals that would take much less time with jQuery.

jQuery

The primary benefit of jQuery is the reduced development time it offers web devs and its easy to use API and numerous plugins. Also, when you use jQuery you are still writing some vanilla JS, so it is not truly one or the other.

The downside is that by adding it to your project you might bloat the resources you need to load, call unnecessarily verbose methods, and avoid learning how the language actually works.

How to choose

jQuery is a fine choice in the following situations:

  • For small projects where perfomance is not a big issue
  • Simple projects with a tight deadline
  • Large projects that use an MVC library or framework that has jQuery as a dependency

Now, times you might not need jQuery include:

  • Acquiring an intermediate – advanced understanding of JS
  • Working on complex web applications
  • Building you own library or framework
  • Server side applications with Node.js

Leave a Reply

Your email address will not be published. Required fields are marked *