As a gentle reminder, Fred Brooks said "there are no silver bullets" in software (<a href="http://en.wikipedia.org/wiki/No_Silver_Bullet" rel="nofollow">http://en.wikipedia.org/wiki/No_Silver_Bullet</a> ). Even without knowing the details of this article, I believe it's unlikely that "not even close" is at all accurate. There likely are advantages, but from my experience (10k+ LOC apps on each Ember, Angular, and Backbone) no one MVC (or MV-) framework is inherently better. They all have serious tradeoffs that SO has done a much better job documenting.<p>One nit from the essay: the author comments on the missing 'model' from Angular and provides an example of a computed property to illustrate this. In many (not all) Angular applications, the server is responsible for the model (think a Parse or other REST-style backend), and the Angular app is simply responsible for rendering it. Angular (err Restangular to be specific) has a way to do this with less code and an aesthetic (data binding in HTML) that I personally like. If, however, you were writing code that needed the client to have a lot more business logic (i.e. computed properties, browser local storage, etc) then something like Ember would be a better choice because of its 'Model.' A lot of shit crud apps, however, don't need that much business logic in the client (at least for an MVP), and that would be my narrative for why Angular <i>appears</i> more popular. That said, I use computed properties in a couple places with Angular, and watches have performed perfectly fine for my use (gallery of 1000s thumbnails). He should disclaim that YMMV.<p>Neither is inherently better, and both teams working on them are full of smart, quality engineers that understand these problems in ways I never will.
A higher level framework makes you more productive but a single bug can get you stuck for hours, days or weeks. A lower level framework doesn't make you as much productive but you have a better mental model of what is going on and bugs get solved quickly. Keep in mind when choosing a framework.
Is there anyone out there who has written non-trivial applications (i.e. a _lot more_ than the quintessential todo app) in both, AngularJS & EmberJS and can offer a non-biased opinion?<p>Some time ago, I started off with AngularJS, I liked what I saw (except the dirty checking part) and started building my product / startup with it. I don't have the time to stop all dev and experiment with EmberJS, but would like to know if it's really better or if it's to-mah-toh vs tom-ae-toe.<p>I mean, how hard could it be to have an AngularJS port where the dirty-checking part is removed and Ember-style getters & setters are introduced (thus removing the only efficiency-related issue that I ever came across).<p>On the other hand, what's the equivalent for "directives" in EmberJS? It's singularly, the most powerful concept that I've come across in AngularJS.<p>Btw, AngularJS has an accepted way to define models -- inside "factories" (I know they just sound like Java-esque hell, but they're really simple, once you get to understand them).
This is a typical reaction from someone who hasn't used AngularJS to build a complex web app. I would strongly suggest you check out our boilerplate for building complex web apps with AngularJS, which uses Backbone for models and AngularJS for UI and data binding.<p><a href="http://brandid.github.io/parse-angular-demo/" rel="nofollow">http://brandid.github.io/parse-angular-demo/</a><p>"In AngularJS, every time you visit a route, it passes an idand has to resolve it in your controllers."<p>- not true, just use nested controllers and prototypical inheritance to access the already resolved object<p>"AngularJS doesn’t follow this philosophy; it encourages you to throw away what you already had and find it again (probably from the server!)."<p>- not true, thats why $rootScope exists<p>"None of the examples or blogs I read through demonstrated how to reuse object instances, for example. Is that just not done in AngularJS?"<p>- not true, all scopes inherit from each other, javascript prototypical inheritance applies<p>"The problem is that the $watch function belongs to the $scope and NOT the Room."<p>- not true, you can put a $watch on the model if use Backbone for your models<p>"If you had an array of Room instances for example, you can’t watch them all without looping through them all constantly."<p>- not true, you can watch a collection of models, and you can do things like watch the length of the array for less processor intensive use of $watch
> Ultimately, I think you should examine your application’s goals. Do you want to build something that pushes the boundaries of what people expect from the web? Is your application going to be super simple, or do you want to add powerful features and maintain it well over time?<p>Yes, thats why I choose Angular over Ember every time. EvilTrout obviously wants to see Ember succeed, I would to if I spent so much time writing a big Ember app and see it loosing out in the Javascript framework wars.<p>The one thing I will say is that his point might be true about performance now, but once Object.Observe lands we won't need dirty checking anymore. It will be easy for Angular to take advantage of it but as far as I understand, Ember will require some major changes to take advantage of it.<p>The way I see it Angular is a forward facing framework showing you how new technologies coming like Object.Observe and Web Components could work together in a framework today.
My personal experience is the opposite.<p>I tried Ember first. Got excited replicating the sample blog app, but got stuck trying a simple task: show the most recent post by default (see this bug: <a href="https://github.com/emberjs/ember.js/issues/1642" rel="nofollow">https://github.com/emberjs/ember.js/issues/1642</a>). Later I started to trip into namespace clashes - you have to jump a few hoops if your model has a field named "content", "is_new" or "is_deleted" (<a href="http://stackoverflow.com/questions/16515900/reserved-atribute-names-in-ember-js-models" rel="nofollow">http://stackoverflow.com/questions/16515900/reserved-atribut...</a>). My general impression is: there is nice ideas here but Ember is too opinionated and has to many magic going on (hard to debug).<p>In contrast, Angular shows better design everywhere. No name clashes, framework methods and attributes use special prefix $ (like python uses double underscores). Everything I got stuck with ember, I was able to achieve elegantly with Angular.<p>I love the eviltrout but this post is lacking a bit of diligence. Angular learning curve is a little steeper but IMHO it is way more finished and well designed than Ember (Ember data has good ideas, they have a cute mascot, and it ends here).
<i>...At that point, what was the advantage of Sinatra? You were basically running a Rails application.</i><p><i>Framework simplicity is good if your application is meant to be simple. But you should be cautious when choosing simplicity if your application is ambitious and you care about supporting it for a long time.</i><p>This is what I like about Clojure. It is <i>so</i> composable, that simplicity doesn't come at the expense of features. The language makes composing disparate libraries so easy, that it's quite trivial to mix and match different libraries and have them all work in tandem. You don't only use what you need, but for every aspect of your application you can choose the best tool for your particular needs.
I haven't used either of these frameworks but I have used Batman.js[1] which has a very similar feel as Ember.js albeit it's written using CoffeeScript.<p>The two issues that this author are singling out aren't exactly addressed fairly so I sort of feel inclined to defend Angular here.<p>Author states that one downside of AngularJS is that it doesn't conform to the Uniform Access Principle. JavaScript the language itself doesn't conform to this either. From what I can tell from my brief review of AngularJS, it tries to be as close to the implementation of JavaScript as possible. I don't see this as a bad thing but rather as a good thing. Using methods like #get and #set drove me crazy when I was using Batman.js. I understand why they exist, but why are #get and #set acceptable ways of accessing object properties but #area isn't? I think they both have the same performance implications, don't quote me on that as I'll never claim to be a JavaScript method cache expert.<p>His first point is that in AngularJS you don't have a true base object that your models inherit from and instead you use plain JavaScript objects. This sounds like another bonus to AngularJS in my eyes! And if it doesn't seem like a bonus to you, you can quickly create a light abstraction to serve as a Model.<p>All in all, having not used either of these frameworks this blog post actually makes me want to use AngularJS more than it makes me want to use Ember.<p>1 - <a href="http://www.batmanjs.org" rel="nofollow">http://www.batmanjs.org</a>
I can't speak much to AngularJS, I've never used it in a project and only spent a few hours playing with the demos. Even if I had, making single one line knocks at either framework is not going to convince anyone of the others value.<p>That said, I have a pretty large Ember app, I adopted Ember for my app when it was known as SproutCore 2 (before AngularJS was known). Both my app and Ember have gone through a very long, very painful maturing process. But it's finally in a really good place. Ember's patterns are the result of months (years really) of spinning, cycling, iterating and collaborating with developers using the framework. Seeing the process of evolution and open collaboration unfold in the community is just as exciting and thrilling as the state of the framework it's self.<p>My advice is to try them both and decide for yourself. The only thing I'd ask is please don't assume one is easier or better than the other with only a few hours of use. If you're planning to build a sizable app, please take the time to evaluate them both thoroughly and decide what's best for you.
I haven't much experience of either framework, but seriously, they're both way too complicated for what they do. Knockout is about the right level of complexity for the problem space, but Angular has the right engineering. But what does it need an IoC implementation for?<p>I'm happy to accept the problem is hard, but I doubt it's so complex it's impossible to decompose.
To read another side of the coin, someone who made the move from Ember to Angular : <a href="http://beust.com/weblog/2012/12/29/migrating-from-ember-js-to-angularjs/" rel="nofollow">http://beust.com/weblog/2012/12/29/migrating-from-ember-js-t...</a>
What I <i>REALLY</i> want is a relatively clean implementation of MV* that I can re-use all parts client and server.. NodeJS is the natural platform, but I haven't really seen much that makes reusing rendering, models and business logic client and server to a natural point. I know that there are people working on this, but I think that getting closer to a solution that can easily converge on such re-use for really dynamic apps, maybe mobile being more server-side, and desktop/tablet being more client will do very well in the end.
Choosing a heavier framework may put you in risk of 'typical', framework-related bugs that often appear. The bugs are not part of the framework, but they are part of the patterns around it.<p>Discourse 'private topics' leaks (1) are good examples of typical security Rails apps bugs (the result of overusing ActiveRecord). I'm not blaming Discourse, the same kind of bugs appear in other popular Rails codebases (Diaspora, Spree, Redmine).<p>Ember.js is very Rails-like. I didn't use Ember much, but the patterns look so similar, that it may lead to similar kind of problems as in Rails apps.<p>I'm not saying that we shouldn't use Rails or Ember. In fact, I'm a big fan of Rails. It's just worth being careful of not falling into the trap of overusing the framework patterns.<p>The frameworks are best for the infrastructure parts of the app - http, persistence. At the end, it's better that you can control your models. That's the part of Angular that I prefer over Ember - you own your Model part.<p>(1)
<a href="http://meta.discourse.org/t/digest-mail-ignores-secure-groups/7288" rel="nofollow">http://meta.discourse.org/t/digest-mail-ignores-secure-group...</a>
<a href="http://meta.discourse.org/t/non-authenticated-users-see-private-topics-in-404-page-was-mobile-view/7419" rel="nofollow">http://meta.discourse.org/t/non-authenticated-users-see-priv...</a>
Interesting article. I don't have much Ember.js experience, but one of the web apps we recently built was built in Angular.js. We found it pretty good to use, but were seriously hampered by the lack of "best practices" and the not-too-hot documentation.<p>We did try to write it in Ember first, but found it much harder, both because of a much bigger lack of documentation, and because the versions weren't very stable and broke from RC to RC.
Coming from someone that has used neither framework, I like the write up w/ examples. However, I wasn't convinced that "it's not even close" so maybe a bad title choice.
Does this boil down to:<p>1) The DOM is the model. JS reads elements and data attributes and builds a model from them. Then updates the model when the DOM changes. (Angular)<p>2) The model is loaded from JSON. Then the App builds the DOM based on the model. (Ember)<p>So is the question: Does it start with the DOM, or start with javascript objects?<p>Am I understanding this debate correctly?
Can you explain what functionality Angular is missing that makes it a less complete framework than Ember? This premise keeps getting repeated here in the form of Angular being "simpler" -- if it's more simple, but offers the same functionality, I'd take that any day.
I know it's really not the point on the article, but I wanted to share a quick and dirty solution for a common problem, especially this:<p>>> If you were using jQuery to do this, you’d likely bind a function to the click event on each row. When fired, your function would change the CSS class of the row to highlight it.<p>>> You can’t stop there, though. Your function also has to remove the CSS class from any other rows that were previously selected. That’s a little crazy if you think about it! Changing which item is selected means we have to know everywhere that it’s been represented in our UI.<p><pre><code> An easy way is just to do:
$('<all-row-selector..>').each(<unselect>)
.find('<selected-row>').each(<select>)</code></pre>
I personally don't like either one, but at the end I'm using AngularJS because it's simpler and has a lower entry barrier, bringing several features that I desperately wanted to have in one webapp: routing, templating and a simple mvc for pushing data from the server to the client with websockets.<p>I have the feeling that, by choosing the simpler framework, I can better maneuver around future complexities as I better understand what sits under the hood. Ember, which seems more elaborate than Angular, tries to anticipate solutions to problems I have yet to encounter. Maybe I'll regret it later. I don't know.<p>The reason I don't like either, or any framework in particular, is that none seems to really make a sane toolchain out of html, css and js.
> I believe it's unlikely that "not even close" is at all accurate.<p>Especially since the opening argument of the author is that AngularJS is gaining momentum because "it is simpler".<p>My personal experience is that when I ported my application from Ember to Angular, my code base (~5,000 lines) get simplified considerably. Based on what I've been reading, I'm not the only one making these observations.<p>My main beef with Ember was not about complexity or simplicity, just that it's not as powerful as AngularJS and it also covers only a small part of what AngularJS gives me out of the box (especially server side includes).
I just have the "feeling" that with Discourse being written in EmberJS, people are mindlessly going to flock to it without really looking at anything else.<p>And even if AngularJS really is better, it will be left behind. Just because...
we're currently working on an angularjs application that has to deal with massive amounts of editable data on screen (think of purchase orders, ship notices, invoices that need to be sent out to walmart, kroger, target scale). although i have had minor issues here and there all you really need to know is what angular is currently monitoring (usually you expose the mutable parts of your models) and exposing that to the angular runtime while hiding what it doesn't need to know to get a performance boost. as for reusability angular services has been both easily and wonderful to use because of angularjs DI approach to everything.<p>this application also has to have a pluggable(200+ different company business/validation rules) rule engine, and being able to configure angularjs services through its providers interface has been very helpful with that problem.<p>we're not done yet so i can't give a final verdict but we've been overall pleased with the framework so far. i also agree with some of the sentiments in here where angularjs does not currently seem to have a culture of what is "idiomatic" angular which can be very detrimental in the short and long run.<p>one of the reasons we didn't go with ember is that the decision was made at the time where in they were making huge changes to ember.
It's not even close <i>for what purpose</i>?<p>For example, there's a wide common case of simple apps hacked together by 1 or 2 developers, traditionally composed of jQuery spaghetti. Maybe Angular is a perfect tool to better organize these typical, not-particularly-ambitious apps, where Ember would be a pre-mature optimization.<p>And perhaps Ember is the perfect tool for sophisticated apps written by teams of developers.
The fact that Google is backing AngularJS is a nice bit of reassurance. But are any of their current apps using AngularJS in any way? I realize most of their major apps, such as GMail and documents, pre-date Angular...but they must use it, or parts of it for something prominent, right?
<i>At that point, what was the advantage of Sinatra? You were basically running a Rails application.</i><p>I disagree. I've built many applications using both frameworks and Rails is overkill 80% of the time, especially in front-end heavy apps where most of your routes are GET/POSTing JSON data.
Coming from Backbone and not really spending any time with either Ember or AngularJS; It seems to me that Ember adopts a more Backbone-like approach to managing Model changes. If only Javascript had a missing method dispatcher, these types of accessor syntax differences would be moot.
Just wanted to point out it's also possible to build a highly responsive single page web app with 10,000+ lines of javascript without either Angular or Ember, or any other framework. For example: <a href="http://plugg.io" rel="nofollow">http://plugg.io</a>
I haven't played with EmberJS too much, but read several times that debugging can get pretty nasty (the poster mentioned something about a run-loop if I remember correctly?).<p>Did you encounter similar issues or do you rely mostly on unit tests for debugging?
I'm mostly a backend web developer but I'm really curious to see where Google is going with Dart + AngularJS. I think there may be something interesting there, for those like me who don't like javascript!
<i>"In the above snippet, there are three models!"</i><p>I'm not sure why this is a problem. A model is just a representation. Could be one, could be many objects.
> but ask yourself this: are all developers on your team going to follow the same conventions?<p>That's the point of using a framework. You need to stick to conventions since frameworks have an opinon on how things should be(Ember does i guess).<p>I never tried Ember ( I will ), but AngularJS comes with a lot of battery included , that's why it is really awesome.