How to Choose a JavaScript Framework

Learn JavaScript

Are you trying to choose a JavaScript Framework? The options for libraries and frameworks that are available for JavaScript developers can often seem daunting. Wikipedia currently lists over 100 “notable” JavaScript libraries, ranging from specialized libraries for testing or templating all the way up to complete client-server frameworks.

Hundreds of articles have been written on the benefits and drawbacks of different solutions. These can be helpful when learning about your options or trying to figure out which framework to use. In this blog post, however, I want to first go back and address the root of the JavaScript library clutter: JavaScript has historically done a lot of things very poorly by itself.

The Evolution of JavaScript Libraries and Frameworks

Twelve years ago, when jQuery was new, it caused a revolution in JavaScript programming because it bridged the gap between different browsers’ implementations of events and AJAX, and it gave us a simpler way of doing DOM manipulation.

Later on, plugins were built for jQuery to address other web development weaknesses such as those having to do with user interfaces.

Today, most of the problems that jQuery was created to address have been solved with improvements to JavaScript, HTML, and CSS themselves. The same can be said for many other AJAX libraries, Promises libraries, modules libraries, and DOM manipulation libraries — as JavaScript gets better, we have less of a need for them.

Understand How the Framework Can Help

The first step in knowing which JavaScript framework to use is to know enough JavaScript to know whether you actually need a framework to do what you want to do.

The line between a “library” and a “framework” is often unclear. Generally, however, a library is a set of functions that you can make use of, and a framework is a complete system that you insert your code into. In most cases, the best reason to use a JavaScript framework or library is to add some sort of opinionated structure to your application, rather than to gain certain features.

One thing that JavaScript still doesn’t give developers much guidance with is application structure. This is where having a framework can be essential. How much guidance a framework gives developers is often referred to as how “opinionated” the framework is. The most opinionated frameworks strongly enforce best practices. Less opinionated frameworks leave it up to the developer to decide on and enforce their own best practices.

An Overview of Angular, React, and Vue

Three of the most popular JavaScript frameworks today are Angular, React, and Vue. In choosing a JavaScript framework, most developers start here.

Angular

Angular is an opinionated framework. It enforces the use of TypeScript, which is a strict superset of JavaScript that is designed to work more like a traditional object-oriented language. Angular features built-in ways to handle state management, routing, data fetching, and the building of applications. If you’re starting from scratch and want a complete solution that will ease the transition for developers coming from a more traditional object-oriented environment, Angular may be for you.

React

React is on the other end of the spectrum. By itself, React is actually just a user interface library. However, when combined with third-party components for handling routing (usually React Router) and state management (such as with Redux), React can be considered a framework. React doesn’t provide clear defaults for how to organize applications, although the React community has standardized on some conventions and best practices. Where React shines is in its ability to work well with other libraries and frameworks. It’s common to combine React with a primarily back-end framework such as Meteor to create a complete client-server framework.

Vue

Vue.js is the most lightweight of the three frameworks, and it’s the newest one as well. It combines some of the best features of React with some of the best features of Angular. Vue contains built-in solutions for templates and state management, but the use of them is optional. Vue is supported by donations and volunteers, and is the only one of the three frameworks listed here that doesn’t have the backing of a giant corporation. Vue is significantly easier to learn than Angular or React.

Other Factors

There are a few other factors to consider as you choose a JavaScript framework.

In terms of job opportunities in 2018, React is currently in the lead, followed by Angular, and then Vue is a distant third.

According to Google Trends, there’s much more interest in React and Angular currently, but there are indications that Vue is trending upwards. My experience is that Vue is currently gaining a lot of interest among developers.

One framework I didn’t mention in this article is Angular’s predecessor, AngularJS. AngularJS is very widely deployed, and existing AngularJS applications will continue to work in the future, but AngularJS is no longer being actively maintained or developed, and so it’s not recommended that you begin any new projects with AngularJS.

Next Steps

No matter which framework you choose, a framework shouldn’t be seen as a substitute for a solid understanding of JavaScript. Armed with the required JavaScript know-how, the decision most often comes down to a question of your personal or company style. All three frameworks have been battle-tested on large projects.

At this time, Angular and React are both considered to be safe and traditional choices. Both of these projects are deployed widely, supported by giant and stable companies (Google and Facebook, respectively), and will be around for the foreseeable future. If you’re the type that likes to be on the cutting edge, you may decide to go with Vue.js. In Vue.js, you’re still getting a well-supported and established framework (it’s been around for more than five years), but you may have to work a bit harder to convince your boss to go with the up-and-coming “new” framework. Five, ten, and fifteen years ago, we were making the same case for switching to AngularJS, Angular, or React from the frameworks that were most popular at that time.

That’s just life in the magical world of JavaScript frameworks!


Learning a JavaScript Framework

Once you’ve selected a framework, consider an instructor-led class to get you up-to-speed quickly. Webucator offers classes on the frameworks discussed in this article, plus others. Here are courses to explore:

Blog Post Author: Chris Minnick

Chris Minnick is an author, instructor, and CEO of WatzThis, Inc. For more than 20 years, he has helped clients with the management and development of hundreds of web and mobile projects. Chris has authored and co-authored more than a dozen books including Coding with JavaScript for Dummies and Beginning HTML5 and CSS3 for Dummies. He has developed video courses for Pluralsight, O’Reilly Video, Ed2Go, and Skillshare on topics such as mobile development and React. His training materials also include courseware that is used for training software developers at some of the largest companies in the world.

About Webucator

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, Azure, Windows, Java, Adobe, Python, SQL, JavaScript, Angular and much more. Check out our complete course catalog.