Why Do I Need A JavaScript Framework?

Why Do I Need a JavaScript Framework?  JQuery Is Easier.

Sure, you might not need a JavaScript framework right now to build a website.  In fact, no one is stopping you from using JQuery in 2020. JQuery is really useful for working with the DOM, given it has a lot of convenience methods that make it easy to manipulate elements on a page quickly.

That said, modern JavaScript (aka ES6) is pretty cool in its own right, and given that many methods from JQuery can be written in less code with modern JavaScript, you might not need JQuery.

What’s The Problem Then?

The problem is LOTS of JavaScript (and JQuery). If you’ve ever worked for a company that has a site on WordPress (or worse, a custom CMS), you’re probably familiar with lots of individual plugin files, as well as theme files that have their own JavaScript and JQuery code.

Debugging the code is often difficult, because it takes time to hunt through every single plugin, module, theme, child theme, etc to figure out what might be the root cause of something not working any longer. 

Why Do I Need A Framework?
What managing a website with JQuery feels like

JQuery is Also Very Manual. 

If you want to do things like build ordered lists or tables, add in content and then later update it on event changes with new data, it’s a bit of work, but it can be done.  Magnify this workload across dozens of lists and tables, and even the biggest JQuery fan starts to walk away slowly.

Things Break.

Code that might have worked a few years back probably gets error messages in the console that tell you to update your plugin code to the newest version of some API. Facebook and Google routinely change their APIs and deprecate functions they no longer support. So you’ll have to go through all the old code and get it updated.   

Be Careful!

But you have to be careful! Because if you update something, other things could break elsewhere that were depending on the previous code.

You may even end up breaking something someone else on the team wrote in code, and now they are upset you are interfering with their work (maybe it cost the company a lot of time and money). Coworkers may also complain that the changes you made broke the website on their browser (and no laughing at them for using IE8 is not a good response).

Hence, this process of rewriting can take weeks or even months, and can become even very political.

Still Not Fixing Problem At Hand…

Even if you are successful in managing all of that, you’re still adding to the overall problem — too much JavaScript everywhere in random files, that you are just putting a band-aid on.

Eventually those band-aid fixes along with the entire legacy code are going to be passed on to the next unlucky person who takes your spot when you decide to tap out.  (If this is your first day on the job, my heart goes out for you. Welcome to legacy code hell.)

Stressed out mom does not like lots of JQuery everywhere

Conclusion: You Might Need A JavaScript Framework

Ultimately, you can still use JQuery if you want.  Just start thinking about whether in the longer term, managing an entire website or web application with JQuery makes sense for you.  If not, you may want to explore a modern JavaScript framework or build tool like React, Angular or Vue.js.