Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Pro's & Con's of 3 Popular JavaScript Frameworks

I am new to Front-End Web Development as I am in the Front-End Web Development Techdegree program. Also, I am new to coding. What might be the pro's and con's of the 3 popular JavaScript Frameworks such as Angular, React and Vue? Thank you!

Hey you can check out this video https://www.youtube.com/watch?v=KoQY8f3bepk

1 Answer

Ezell Frazier
Ezell Frazier
22,110 Points

I haven't had much experience with Angular and Vue in contrast to React, but I'd say the pros and cons depend on what you're looking to do.

For instance, Angular is highly opinionated, meaning there's generally one way of doing things when building an application. This could be good for those that are working in large teams or do not want to deal with a lot of weird quirks when a project scales in size.

However, this could be a con for those that want to get a web application up and running without enduring a relatively steep learning curve on how to do things the Google way.

Another controversial topic with Angular involves two-way data binding. An input field with two-way data binding could be updated by the view and or any logic executing behind the scenes. This could cause unintended side-effects for less-cautious developers.

Lastly, Angular is a full-fledged front-end framework, meaning a developer has all the tools they need out of the box to build a front-end web application (all of your DOM elements, form validation, routing, data flows, a test suite, etc.).

In contrast to Angular, React and Vue is JavaScript libraries. They're relatively bare-bones out of the box, which means you can use NPM to gather whatever tools when your project calls for them. I haven't performed any speed-tests or anything, but I'd imagine the time it takes to compile a basic app in Vue/React is much quicker than Angular.

Touching on React a bit, this is sort of my go-to library when developing an app. Only out of sheer familiarity and comfort than 'this is the best framework and you should use it'.

Although React is hardly opinionated compared to Angular, developers will get the most mileage when embracing a functional way of programming, meaning all functions take an input and return an output, and don't require the application to be in a specific state to test. This could be somewhat of a weird thing to embrace if one is coming from an object-oriented way of doing things.

A controversial point with React is JSX, its JavaScript interpretation of HTML elements. Many developers strive to separate their markup and logic from one another (like with using Angular for example), but many developers choose to incorporate JSX right within their component classes, which can really lead to some overly verbose code if one's not careful.

Lastly, if I've spent a month's worth of time using Angular, I'm about a year 1/2 in with React, so I'm like a week in with Vue.js. And I must say Vue is the easiest of the three to jump right into. Logic and markup are separated from one another, and the markup isn't exactly HTML, but it's much closer than whatever we want to classify JSX as. But like React, Vue is really bare-bones out of the box. You'll need a good amount of packages for things such as state management and form validation.

So a TDLR;

Angular

  • Highly opinionated (makes startup time longer, but code cleaner for others to work with)
  • All of the tools you'll need out of the box (but this may lead to longer compile times and application bloat)
  • Two-way data binding (can frustrate the unweary developer early-on)

React

  • Not a 'framework' (you'll likely need additional packages for 'basic' functionality, but easy to get started ASAP)
  • Encourages functional programming (to keep code clean and easy to read, to say the least)
  • JSX (some love it, some hate it... at least it's optional)

Vue

  • Probably the lightest of the three options here (so you'll need a bit more external packages for 'basic' functionality)
  • Keeps logic and markup separated really well
  • Super easy to get into