Jeremy & Yehuda touch on most of the issues in this post and you can hear the points directly from their POV rather than filtered through someone else.
Additionally it's interesting to hear that Jeremy & Yehuda are at odds (philosophically) on several other issues which I think help to round out the ideas behind Backbone, Ember, and other projects both of them are involved in.
> Backbone by itself is not sufficient for building complex web apps.
That bit is particularly galling ... It's one thing to opine about stated philosophy, and another thing to really look at how the rubber hits the road.SproutCore/Ember (5 years worth of apps, major corporate backing): http://sproutcore.com/#application-slider
Backbone.js (1.5 years worth of apps, just plain 'ol open source): http://backbonejs.org/#examples
'nuff said.
Ember is a total, ground-up rewrite of some of SproutCore's ideas and you know it. I don't count any SproutCore examples as Ember examples, and saying that Ember is anything other than plain 'ol open source is unfair.
I don't count the time you spent on Backbone at DocumentCloud against Backbone's open source, because it would be ridiculous to do so, and you shouldn't count time spent at Tilde working on Ember (mostly on our free time) against Ember being open source.
Our largest contributor (according to https://github.com/emberjs/ember.js/contributors, Peter Wagenet) has done almost all of his work on his free time, and we have a wide variety of contributors who were never on the payroll of this so-called "major corporate backing".
There's a lot that you validly disagree with about our approach, but trying to attack us for being "not real Open Source" is a low blow.
But, I do think that looking at the empirical -- what's been built with 'em, and how -- is one of the most useful points of comparison.
> Backbone by itself is not sufficient for building complex web apps.
What he meant was that for any complex web apps built on backbone.js, you have to build a layer on top of it or use additional plugins. You won't build complex applications as is.IMHO, I consider backbone.js more as a base framework which you need to enhance before starting your project. So, in a way, every complex backbone.js app is more of a <Complete new framework> extending Backbone.js.
A proof of that is mostly the number of available plugins (which is great!!). As a matter of fact, ender could be written on top of backbone.
A complex web app, pretty much by definition is going to need some features that other web apps aren't going to need, not so? And those features are, according to the stated goals of Backbone, not going to be found in the core, right? (In fact, I seem to recall people asking for features their particular complex web app needed, and being told that stuff didn't belong in Backbone core...)
Boris' seems to be re-stating Backbones' mission statement, which I don't see being a knock on Backbone at all. And I'm really not sure what a list of people using Backbone is meant to prove. Boris is saying that any of those people using Backbone for complex apps will have to extend it a bit - which is one reason Backbone is made to be so easily extendable. Is that wrong?
It's an example of what you get when you follow the "framework does everything but the kitchen sink" philosophy to the end and pile on feature after feature. (It's open source, too!) It's great if you need to hack together a "enterprisey" client and don't really care about style or extendability (rare but these requirements happen.)
The databinding support, controls, and the amount of stuff it does out of the box is absolutely incredible for a free open source framework. But, it's ugly as hell, bloated, and if you want to do anything off the beaten path, you're fucked. But it's a remarkable piece of engineering that goes under the radar (similar to OpenLaszlo) but also a cautionary tale for the Ember guys to not take it too far.
Luckily, providing a widget library is, and will always be, outside the scope of Ember.js. While we'd be quite pleased to see someone else develop a widget library on top of Ember, it's not something that we're personally interested in doing.
The goal of Ember.js is to roll up common patterns web developers are using into the framework so that they can write less boilerplate. In fact, part of the reason we renamed SproutCore 2.0 to Ember.js was to emphasize the point that our value proposition is in the architecture, not the library of controls.
As a veteran of the SproutCore project, keeping things lean and focused is my top priority. And, if it helps, we're all extremely allergic to anything that feels "enterprisey." :P
FWIW, I'm not an expert on Ember.js or Backbone; just someone trying his hand at hacking the Ember.js code to work more effectively with collections (since some of the use cases I have would be impossible using the current methods of bindings and collections).
How large is large enough to cause problems?
About 10 months ago, Strobe was trumpeting the "Ember" model for views (auto-updating templates, heavy nesting, bindings everywhere) and a lot of SproutCore developers began to use it.
The bloom is definitely off of that rose. At the latest user group meeting three weeks ago, many developers spoke up about having to remove all of their template view code because the performance was absolutely terrible.
At this point, "Ember-style" template views have been relegated to a separate opt-in library, are only being recommend for lightweight read-only data, and the recommendation for developers to use them is being removed from SproutCore's documentation.
I have run into this. It’s really frustrating, in Backbone.
In my experience, there's very much a need for a controller when writing even
moderately complex apps. You're presented with several options:
1. Write controller code in views
2. Write controller code in models
3. Write controller code in a router
4. Write your own controller infrastructure
If you care about separation of concerns, none of these options are really
acceptable.
I care about separation of concerns when it's limiting the program complexity, and I don't have any problem with 3. Routing code is very lightweight, and it's sometimes beneficial to associate it with controller code -- those concerns are closely related, and not often referred to separately. In backbone, it's very easy to split a router into many (controller-style) files. If others have experiences to the contrary, I'd be interested to hear them.On a practical note, my experience earlier this week suggests Backbone right now is far easier to get your hands dirty with. I was excited to use Ember, but I had a practical time constraint and discovered it's a rough ride right now, so reverted to Backbone for this task. There's really very few examples, unless you want to start diving into older Sproutcore docs and trying to figure out the diffs.
In contrast, Backbone has a wealth of articles and even design patterns and books. Of course, it's an apples-versus-oranges distinction with Ember being so much newer, but an important practical issue for developers to be aware of if they're deciding right now.
FWIW, the SproutCore community has rejected the Ember approach for the kinds of apps SproutCore is meant for: large, desktop-style apps that need to run fast in modern web browsers. The supposed "features" Ember provides, like auto-updating templates, have proven to have such bad performance in existing SproutCore apps that developers have almost universally been ripping them out (this was discovered at the most recent SproutCore User Group last month).
Ember is an alternative to Backbone -- a 600 LOC micro-framework. That should tell you all you need to know about Ember's scope. (SproutCore is well over 20K LOC.)
I've been writing my backbone app effectively with nested views, where parent views pass relevant information to child views either through initialization or functions on the child view, while the child view "communicates" with the parent view through events that the PV can bind to.
I kind of like the idea of child views not knowing or caring who created them or why. I do this e.g. with buttons, forms, panels and subpanels, etc.
Is there a good resource for best practices here?
Edit: Chrome on Windows is ok, maybe there's something wrong on my Linux installation
-Examples of the built in controls(tab,select,textfield,textarea). There are only like 6 of them but when you find out they exist and are not documented they feel like 600. The sroutcore history amplifies this assumption.
-The fact that sub views(ie textfield) don't bubble but are really easy to implement by extending TextField. See: http://stackoverflow.com/questions/8646238/handling-blur-on-... (PS. Why is this? It seem silly that I can't do {{view Ember.textField change="parentview.change"}} in my views.)
I don't agree.
The fact is that BB is stable and has loads of documentation and live apps. Ember not so much.
I ought to connect with the community more, but so far getting up and running with it (and building a moderately complex app) has been a breeze, as far as Backbone is concerned.