Posts Tagged ‘ember vs angular

Devil or Deep Blue Sea ? The pain in choosing the two heroic MVC frameworks

with 5 comments

Of late, for the past few months I had been working on Ember. Few of my old posts would have been on angular-1.x. From my hands-on in both, I’m listing the pros and cons observed. This blog definitely doesn’t mean that I’m anti-angular now.

Angular and Ember both are client-side framework giants which help develop single page web applications. The below comparison is in reference to ember-1.x and angular-1.x

  • Coding style:The significant difference that I felt when I was working with ember was its coding-standards – ’ember way of coding’
    ie., In angular if there are different ways to do a single task and the developer can make the choice based on his needs, ember provides only one best way to do a task and the developer is forced to follow that. This inturn lead to clarity, reusability & scalability advantages when the app got bigger.
  • Data Layer: Ember has an excellent optional data layer. Ember’s model classes help a great way in handling properties and its relationships, dirty checking etc.,
    In angular, we don’t have a proper model-base class. It attaches everything to $scope.  Dirty check using $digest at times has performance lag.
  • Data Store: In Ember, we query data using ember data store query. The data fetched is then stored in ember-data-store. When second request is made, results are fetched from in-memory store.
    Whereas angular treats every request to be new. It discards what it already had and makes a request again. Though angular services help store data, they do not serve upto the capacity of ember-data-store.
  • Computed property in ember observes change in property value dynamically during runtime.
    In angular this is done using $scope.$watch but it gets tedious when that particular object had to exist in other controllers too also causing performance degradation.
  • Project Structure: Ember’s pod structure helps organise app in a feature driven approach i.e., our files are grouped by functionality  rather than by type. This gives a lot of control and helps scale apps when they get bigger.
    Angular also helps structure code based on feature but angular is very flexible
    The difference I would like to highlight here is  Ember drives the pod structure, whereas in angular the developer drives the structure.

Accepted that, there was a havoc in developers mind when we where told that almost most of the code in angular-1.x cannot be reused / migrated to angular-2.x. This created a little tension and confusion while selecting frameworks.

However now looking at angular-2.x features (like performance optimisation, native support, es6 & es7 features), it’s sharply showing that it would give a great reach for forthcoming projects which would implement it.
Ember-2.x is also of no less with its features like very high speed performance, server-side rendering etc., [Ember-2.x coupled with Glimmer engine – the app is going to fly].

Having worked in both the frameworks, I feel Ember and Angular both are close to eachother and are equally good. The main determinant in choosing the framework is the learning curve,  community support, regression free migration to releases, time to deliver etc.,

Written by thangaveluaishwarya

January 17, 2017 at 12:16 AM