Live data from Hacker News

AngularJS versus Ember

eviltrout.com

11–20 of 163 posts

Re: AngularJS versus Ember

#11
...At that point, what was the advantage of Sinatra? You were basically running a Rails application.

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.

This is what I like about Clojure. It is so 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.

Re: AngularJS versus Ember

#12
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.

Re: AngularJS versus Ember

#13
As a gentle reminder, Fred Brooks said "there are no silver bullets" in software (http://en.wikipedia.org/wiki/No_Silver_Bullet ). 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.

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 appears 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.

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.

Re: AngularJS versus Ember

#14
post #6

It's not even close for what purpose ? 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. And perhaps Ember is the perfect tool for sophisticated apps written by teams of developers.

> It's not even close for what purpose? As the article says at the end: > 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?

Read on

> If you’re serious about front end development, I advise you to take the time to learn Ember properly.

The article isn't fair to Angular. It's like saying, If you're a professional web designer, you should always use semantic markup and a CSS pre-processor, and never Twitter Bootstrap. In fact, Twitter Bootstrap and Angular both have their places alongside Sass and Ember.

Re: AngularJS versus Ember

#15
> but ask yourself this: are all developers on your team going to follow the same conventions?

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).

I never tried Ember ( I will ), but AngularJS comes with a lot of battery included , that's why it is really awesome.

Re: AngularJS versus Ember

#16
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.

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).

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.

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.

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.

(1) http://meta.discourse.org/t/digest-mail-ignores-secure-group... http://meta.discourse.org/t/non-authenticated-users-see-priv...

Re: AngularJS versus Ember

#17
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?

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.

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).

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.

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).

Re: AngularJS versus Ember

#18
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.

And even if AngularJS really is better, it will be left behind. Just because...

Re: AngularJS versus Ember

#19

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. 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,…

Those private topic bugs are not the result of ActiveRecord. We added a group layer on top of existing code and missed some places where queries did not respect it.

Had we used raw SQL instead of an ORM we would have had the same issues. All projects are open to this style of bug. The correct thing to do is report, close them quickly and add tests to prevent them from happening again (which we do.)

Re: AngularJS versus Ember

#20
"In the above snippet, there are three models!"

I'm not sure why this is a problem. A model is just a representation. Could be one, could be many objects.

Post reply on HN