Nikhil Navadiya

A full-stack developer who is passionate about to make web "awesomely" as possible.

Choosing a javaScript MVC framework

Over the last several months I have been trying to find the perfect javascript MVC framework. And I have been ended up by doing following research.

As a frontend perspective, there are really important features the framework should have to provide the necessary foundation to build useful applications. They includes view bindings, two way bindings with element, computed properties, attributes management, form validation, etc. Below is a comparison of what I consider the really important features in a MVC framework:

Feature Angular Backbone CanJS Ember
Observable Y Y Y Y
Routing Y Y Y Y
View Bindings Y N Y Y
Two way bindings Y N N Y
Partial Views Y N Y Y
Filtered list views Y N Y Y


Flexibility
In terms of flexibility, Backbone is the most flexible framework as it is the one with the less conventions and opinions. We will required to make a lot of decisions when using Backbone. While Ember and Angular are still flexible frameworks to some degree but you will find that you could end up fighting the framework if you don’t like the way it does certain things. There are some things that you just need to buy into when using Ember or Angular.

Learning curve and documentation
Angular has a very high wow factor at the beginning. It can do some amazing things - like two-way bindings - without having to learn much. And it looks quite easy at first sight. But after you have learnt the very basics it is quite a steep learning curve from there. It is a complex framework with lots of peculiarities.

While the basics of Backbone are quite easy to learn. But soon you find that there are not enough opinions there to know how to best structure your code. You will need to watch or read a few tutorials to learn some best Backbone practices. Also you will find that you will probably need to learn another library on top of Backbone (e.g. Marionette or Thorax) to get things done. So I don’t consider Backbone the easier framework to learn.

And for Ember also has a steep learning curve like Angular, I believe that learning Ember is easier than Angular but it requires a highest learning investment at the beginning to get basic things done. Angular in contrast lets you do some amazing things without learning too much. Ember lacks this early wow factor.

Community
The Backbone community is huge, there is no doubt about that. You can find dozens of tutorials about Backbone, a very active community on StackOverflow and IRC.

The Angular and Ember communities are pretty big as well. Also lots of tutorial and activity in StackOverflow and IRC, but not as much as Backbone.

Size
Size library alone (no dependecies, just min)

  • Angular - 80k
  • Backbone - 18k
  • CanJS - 33k
  • Ember - 141k

Size with dependencies

  • Angular - 80k
  • Backbone - 61k
  • CanJS - 57k
  • Ember - 269k

Maturity
Backbone has a ton of websites built with it(e.g. soundcloud). Its code base hasn’t had major changes in the lasts two year which is a great thing from the maturity perspective.

Although Ember is not that new, it has had major changes along the way, just reaching a stable form in the last couple of months. So at this time I don’t consider it to be a mature framework. Sqaure, zendesk, etc are using it.

Angular seems more stable and proven than Ember. But not as much as Backbone. Google is using it.


So which framework?

I think you should go through the article on smashingmagazine.com. It explains everything in detail and helps you on which framework and when we should use it.

Personally I like angular because its app structure and declarative HTML(Extending HTML). Also it is built by Google. Google has one of the strongest engineering cultures. The quality of documentation is really good and there are plenty of example code and apps out there which help tremendously in getting started.