5 ms·
The more I look at Ember the more it reminds of a framework named Batman[0] I used over two years ago. It's almost a complete replica, all the way down to Ember
by rubiquity 12y ago
The more I look at Ember the more it reminds of a framework named Batman[0] I used over two years ago. It's almost a complete replica, all the way down to Ember.Object being identical to Batman.Observable.
The problem with Batman (aside from being buggy) was that it tried to do this same MVC that we use on the server on the client, and the mapping just doesn't make sense. HTTP "MVC" doesn't have state between requests whereas client-side MVC has state for the entirety of the app. Rails, for example, has a Router and Controller due to the synchronous nature of how a request comes in and gets turned into a response. The first place I see MVC JS frameworks fall apart is when they have both Controllers and Routers. Ember Controllers look like little more than Decorators. I imagine these would be called a ViewModel if named appropriately.
Over two years later, I can't help but feel Backbone (minus the underabstracted View layer, which can be easily replaced with React) got the mental model for JavaScript apps right from the start.
Ember just seems to have been marketed much better than Batman was, which is no surprise, Yehuda is good at doing that.
0 - http://batmanjs.org http://batmanjs.org
- 3pt14159 12y agoEmber handles App state very well. It is easy to take advantage of local storage when you need it, and the way that changes in the data are bound with changes in the view makes it very easy to create pro-level web applications.
- deleted 12y ago[deleted]
- rubiquity 12y agoNothing about what you just said is specific to Ember. Two-way data-binding is common in just about every framework, or can be added in cases like Backbone. Easily using localStorage is also common because just about every JS framework uses the Adapter pattern for persistence.
- xiaomai 12y ago> Ember just seems to have been marketed much better than Batman was, which is no surprise, Yehuda is good at doing that. I don't think this is fair. We use Ember at work, although I wish we used React. We started out on Backbone and it was miserable. Ember has gotten popular because it and Angular were seen as the successors to Backbone for a long time. Ember is designed in a much more thoughtful (and I think better) way than Angular. Yehuda has done a lot of good work on Rails, Bundler, jQuery. That probably helps sell people on his projects. I wouldn't chalk it up to marketing.
- deleted 12y ago[deleted]
- rubiquity 12y agoYou're right. Yehuda's great work and open source contributions definitely help a lot. I don't want to discount that.
- walkon 12y ago> We use Ember at work, although I wish we used React. Could you expand on why you prefer React? I have not tried React yet, but am interested to hear thoughts from someone who's used both.
- adamnemecek 12y agoI'm interested in that too. Is it fair to compare Ember and React though? It seems like they are trying to solve different issues.
- KurtMueller 12y agoThink of Angular directives, Ember components, and React components as attempting to solve the problem of web components in your view. I'm using react right now in a rails application at work. While it hasn't totally replaced my haml views, I definitely sprinkle it in where appropriate. It does a great job of handling dynamic uis and gives a standard, easy to understand structure to my javascript. I think of it is as a next step beyond jQuery. In my opinion, React forces you to think of your view as a hierarchy. You are forced to think about what components make up your view and what its responsibilities should be. React components also come with some standard methods in regards to the lifecycle of each components and the state of your data as it flows up and down the hierarchy of your components. I've really enjoyed the experience thus far. I'm not necessarily a fan of putting any sort of html-like structure in my javascripts, but Pete Hunt, one of the core contributors to React, explains his reasonings quite well in many talks you can find on Youtube. -- Also, Khan Academy uses Facebook React in its perseus q&a system. You can view blog posts by two Khan developers about React here: http://benalpert.com/2013/06/09/using-react-to-speed-up-khan-academy.html http://benalpert.com/2013/06/09/using-react-to-speed-up-khan... http://joelburget.com/backbone-to-react/ http://joelburget.com/backbone-to-react/
- Nemcue 12y ago> "(...) got the mental model for JavaScript apps right from the start." If you remove the Views from Backbone the only thing left of value are the Models and Collections. Are you saying they got those "right"? I really have no idea what that means. On the contrary — I think Backbone got a number of things wrong. Their router especially. > "Ember just seems to have been marketed much better than Batman was (...)" You said that Batman was buggy and got MVC wrong. Perhaps Ember is /not/ buggy and actually manages to deal with state quite well?
- jashkenas 12y agoThe reason why Backbone views are so minimal is precisely so that you can use the HTML/UI abstraction of your choice. For some teams that's Underscore templates, for some it's Handlebars, for some it's in-house widget libraries, for some it's React.
- Touche 12y agoBut the UI abstraction is the hardest part of JS, which is why so many people are moving away from Backbone, it doesn't help you with it at all.
- steveklabnik 12y ago> The first place I see MVC JS frameworks fall apart is when they have both Controllers and Routers. You have to remember that MVC is a very, very loosely defined term. The Ember MVC is very, very different than the Rails MVC. Ember's is much closer to Cocoa or Smalltalk in this regard. To see how these bits fit together in Ember, I highly recommend seeing Tom's talk on URLs and their importance: http://vimeo.com/77760308 http://vimeo.com/77760308 (you can skip the first 12:35 or so, and around 30:38 is where it really gets into it.)
- archagon 12y agoExactly. Ember is directly inspired by Cocoa, and Cocoa has been using stateful MVC with incredible success for the past decade.
- steveklabnik 12y agoOh, ThoughtBot wrote a WONDERFUL post about this today: http://robots.thoughtbot.com/shared-terminology-yet-different-concepts-between-emberjs-and-rails http://robots.thoughtbot.com/shared-terminology-yet-differen...