JavaScript Framework Showdown - Which Should You Use

With so many JavaScript framework options to choose from, it’s no surprise a lot of developers are wondering which they should use for their build. If that sounds like you, you’re in the right place. To make your framework decision easier, we’ve outlined the pros and cons of AngularJS, Backbone.js, and Ember.js, based primarily on our own experience teaching these courses at Code School.

word-image

AngularJS

AngularJS is a client-side JavaScript framework that allows you to organize large, client-heavy applications into something manageable. Known for its versatility, Angular shines with nifty features like two-way data binding and the ability to make custom HTML tags/attributes/comments that encapsulate functionality. If you want a framework that makes your HTML more declarative and gives you neat features like directives, then AngularJS is a great choice (see examples here).

Angular’s biggest drawback is having many ways of accomplishing the same thing. And, until you use Angular for a fairly big project, it’s difficult to figure out exactly what the best approach is. You also need to be careful to clean up events and DOM elements to avoid memory leaks. If you want a more opinionated framework that forces you to structure code in a particular way, then you might want to look at another option.

Backbone.js

Backbone.js is a minimalistic JavaScript framework that gives structure to web applications by pulling your "truth" — your model — out of your DOM and into Backbone’s Model, Collection and View objects. Perks include its small size, only 6KB for the entire production version library, and far fewer concepts to grasp than Angular or Ember. Backbone is easier to get started with and allows for greater control over the method of implementation, plus, as one of the first JavaScript MVC (or what most call MVV) frameworks, Backbone has a head start on other frameworks (see examples here).

Unfortunately, the "hands-off" approach of Backbone may mean implementing many features that are already in other frameworks. Backbone doesn’t include data-binding—the ability to have changes in one place trigger a change elsewhere. You could set this up on a per-case basis, but it’s not a core feature of Backbone.

Ember.js

Ember is a framework for creating rich JavaScript web applications. Ember boasts conventions that can help developers collaborate and be more productive while writing better code. Ember also has top-notch router and URL handling, and is typically used for building long-lived applications, such as admin dashboards where a user is expected to keep their browser open for many hours (see teams using Ember here).

On the downside, after you get past the basics of Ember the learning curve can be pretty steep. Since the API has changed so rapidly, you may also find a lot of the online code examples are out of date.

Still Not Sure?
Hopefully this quick guide has been useful. If you still aren’t sure which is the clear winner, the best way to choose a framework may be to test them out yourself. At Code School we offer intro courses on AngularJS, Backbone.js, and Ember.js, and there are plenty of other resources online to help you learn.

About the Author:
Gregg Pollack is CEO of Code School. Follow him on Twitter at @greggpollack. Special thanks to Adam Rensel, Adam Fortuna, Carlos Souza and Dray Lacy for contributing to the framework showdown, and Lauren Orsini for the featured photo.