Live data from Hacker News

Advice On & Instruction in The Use of Ember.js

trek.github.com

71–72 of 72 posts

Re: Advice On & Instruction in The Use of Ember.js

#71
post #42

Ember looks cool, but knockout lets me ship fast and it's less "magic". Also, I think single page apps have a place as part of a greater architecture, but not as the entire app. If I wanted an entire app everything to be JS, fine, use Ember or something like it, but most parts of the web don't need this and single page apps make the web a bit worse if not done correctly. Single page apps are the new hotness, but once…

> Ember looks cool, but knockout lets me ship fast and it's less "magic". I'd appreciate it if you could quantify what you mean exactly by "magic". For example, one key difference between Ember and Knockout is that Ember's binding system automatically avoids triggering the same side-effect from multiple pieces of code. For example, if you had a piece of the DOM that was calculated from several observables (the stupid…

I think ember and knockout do the same thing here. In fact my impression was that knock out actually only rerenders the part of the template that was affected while ember does the whole view. This may have changed since 0.9.6.

Re: Advice On & Instruction in The Use of Ember.js

#72
post #67
post #62

As the guy who wrote the first bits of the Rdio code in question, it seems worth mentioning that the part in question has nothing to do with Backbone, or Ember, or anything else. That code is a cleanup function on an object that helps to abstract HTML5 vs our Flash fallback. No matter what framework you are using, if you are solving the problems that we are solving, you are going to end up with that code. Now, that s…

Is this entirely true? Clearly cleanup of event names like "loadedmetadata" is related to the audio element but '_bubbleProfilingEvent', '_logEvent', and general .unbind calls are on backbone-related objects, yeah?

The only backbone related code in that snippet is the .unbind() call and the .trigger call. This is needed because this is our wrapper around the media element; it is an event emitter. If you're going to make something emit custom events, you'll need code to emit them and clean them up when you're done.

One area where backbone is lacking is lifecycle management. You do sometimes have to unbind things in order to prevent leaks. Backbone is very minimal in this regard. At Rdio, we've built our own tools on top of Backbone to abstract lifecycle away from the developer as much as possible. That being said, that weakness isn't illustrated in the code example picked by the blog post.

Post reply on HN