That was my tweet last night that attracted some attention. Some responded along the line of "why", so I probably raised some eyebrows as well.
@danie11am can you give a quick overview of ether differences and why one over the other?
interesting take! How so?
interesting. I haven’t tried #emberjs yet. What’s the most striking improvement over #angularjs?
These were my immediate responses:
- let me try. #angularjs 2-way binding is great, but it's still (just) a handy toolkit for building website.
- #emberjs is more like bringing the native (mobile) app dev environment to HTML5. That's very different from other framework.
- yeah not saying #angular is bad.. it's probably even a better option in many cases. But #emberjs operates on a different level.
- with #angularjs you can make it as simple or complicated as you want, it's a JS toolkit
- w/ #emberjs the MVC structure (or M-Template-C rather) is all set and ready to go so more akin to native app
Now if you want to hear my story...
AngularJS is great
First off, AngularJS is great. And I'm not saying that because I'm diplomatic. In fact, when I initially evaluated which JS library/framework/toolkit to use, I picked AngularJS. Why? Because...
- AngularJS is popular - more popular than Ember.js according to many, quoting metrics like number of stars in GitHub repository and Google trend.
- It's easier to get going - Many say Ember.js requires a steep learning curve.
- AngularJS offers two-way binding between displayed value and variable, which is powerful and what I needed at the time.
So I chose AngularJS rather than Ember.js and I'm still using it for that part of my project. AngularJS is great.
Ember.js is jaw-dropping-ly awesome
In another part of my project, I need to build some kind of admin interface and it is quite a lot more complex than what I built before using AngularJS. I don't recall exactly why I reconsidered choosing a different JS toolkit/framework. This post by EvilTrout might have made me rethink a little. But I remember asking myself - How does Ghost (the blogging platform) do it?
Ghost is the only large-ish open-source Node.js+HTML5 project that I know. So I looked around and there was actually a very long discussion exactly on this topic, about which JS framework to use to implement their admin UI. In the end they came down to AngularJS-vs-Ember.js and picked Ember.js. That's when I decided I should give Ember.js a go as well, and started using it.
Now some may say "What? Are you saying AngularJS cannot be used to build web app"? No, that is not what I said.
Consider how a command-line program is built. Now consider how a GUI program like a native mobile app or a desktop application is built. How are they different? Why are frameworks often pre-defined when writing GUI programs, so that you just need to fill-in implementation for some callback functions/methods?
Because, when forced to use framework, we coders don't scratch our heads and say, agh, we are building user interface and need a view, so let's make a view object. Let's see what properties should be defined there. Or, let's see how we can control this view. Hm, from here or there? No.. these decisions have already been made, for good reasons.
Building website, in its root, is writing documents. That's why you have tags and styling and all that. Building web apps however is not writing documents. Ember.js recognises that and offers the corresponding framework by building on top of the same old HTML+JS. That's clever and why I found Ember.js jaw-dropping-ly awesome.
So, which one is better? The question should be "which one is better for (some purpose)". I hope the heated discussions about HTML5 toolsets will not become as holy as the vi-vs-emacs war.
By the way, this project of mine that got me into this? It's a start-up service mainly to serve mobile app developers. It will use a healthy mix of (drum rolls.. ) Ember.js, AngularJS, Bootstrap for frontend and Node.js, Express.js and MySQL for backend. Stay tuned. Wait - Why MySQL instead of MongoDB? Ok...
- Someone's saying why Ember.js is better than Angular.js in some ways