Skip to content

Instantly share code, notes, and snippets.

@jblanche
Last active March 29, 2016 17:40
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jblanche/4672817 to your computer and use it in GitHub Desktop.
Save jblanche/4672817 to your computer and use it in GitHub Desktop.
Should I use Angular / Backbone or Ember ?

AngularJS

Pros

  • Perfect for complex "client-side" application, where the complexity is more in the way "components" of an app interacts with each other than in the way they sync and or interact with a backend.
  • Very clean separation of concerns
  • Uses concepts that kind of look likes the future of HTML/DOM (DOM templates, binding attributes…).

Cons

  • A bit complicated to grasp. A lot of new concepts.
  • jQuery or another dom parsing framework in directives may be painful to use (need more tests) because of the way angular compiles templates (see http://egghead.io/video/angularjs-angularelement/).
  • Still under heavy development, some stuff changes a lot in the master version (but 1.0 can get you started)
  • Some common things are still unavailable (you can't show or hide a view with an animation like fadeIn / fadeOut).

Tl;DR

Good for application with a big level of complexity on the client side, but you'll need to learn A LOT of new stuff.


BackboneJS

Pros

  • Very easy to start with.
  • Very small.
  • Can be used with any external library.
  • Documentation is good (it's easier to document a small project)

Cons

  • It does just a few thing to help you create a good structure for you app, but you still have to do much of the work ! (even simple things like cleaning events binded to a view when you remove the view).
  • If you add other components on top of it (Marionette, Chaplin, Thorax), the learning curve increases ( but not that much and code complexity decreases).

Tl;DR

Good for small and simple applications and easy to understand.


EmberJS

Pros

  • Convention over configuration, you can get a lot of thing working with just a few lines of code ! (see https://peepcode.com/products/emberjs)
  • EmberData looks perfect for syncing data between your app and a server api and/or localStocalStorage (especially if your server code follows a few convention, Restful routes…)
  • I do trust Yehuda Katz and Tom Dale work a lot !

Cons

  • Still under heavy development, some stuff changes a lot (especially for EmberData).
  • You're forced to use the Handlebars template engine (but it's a good one so not really a big con)
  • Documentation is getting better every day but still far from perfect.

Tl;DR

Good for applications where you need to deal with syncing data with server and/or save it offline. Looks like a good fit between Backbone and Angular but still young…

Other articles

@ayamflow
Copy link

ayamflow commented Jan 3, 2014

Just stumbled upon this. Maybe a bit late, but I think the performance is also a significant factor to take into account.
Speed of rendering, and size.
Which gives :

Backbone: Super light, but strong dependencies with JQuery & Underscore (~50ko I think). Precompiled templates are possibles, so really fast, but the whole view needs to be rendered on model change.

AngularJS: Relatively heavy (80ko), lesser need on JQuery but easier with it (which will bring it to 110ko). Data-biding enables to render only the part of view binded to the updated model, but the dirty-checking system is painfully slow when the page has a lot of bindings.

Ember: Not tested, I think the templating performance is halfway between Backbone & Angular, because it allows precompiled templates, but the whole framework is over 250ko ! (EmberJS: 180ko, Ember data: 70ko, Handlebar runtime: 10k).

@marcofiset
Copy link

A major con for Angular : the documentation sucks. A lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment