Wednesday, June 19, 2013

Heretical Guide To Ember JS

I've written a new ebook. It provides a detailed introduction to Ember.js.

One enormous caveat: it doesn't deal with the data layer at all. I think this is fine, because Ember Data hasn't gotten near 1.0 yet, and Discourse and some other Ember projects roll their own data layers anyway. Nonetheless, my new book's 108 pages long, with extensive code samples, because there's a lot of other material in Ember to cover.

The book covers a few different Ember "hello world" implementations, then shows you how to build a trivial GitHub notifications API reader, and then walks you through building a complete chess game, with HTML5 drag and drop, and similar user interface flourishes.

The gradually-increasing sophistication of these example applications helps me acquaint you with the Ember mentality. Ember's widely known to have a somewhat punishing initial learning curve. By starting out super easy and building more and more sophisticated code, my book can get you through that learning curve much, much faster.

My book also takes a critical examination of Ember's idea of MVC. Spoiler alert: I don't think Ember chose its class names perfectly. I don't think the Ember Controller really is a controller, for example. But I do think Ember is useful. In the same way that experienced Rails developers have to achieve a sophisticated and sometimes critical understanding of Rails in order to make subtle decisions about how to use Rails most effectively, I deconstruct Ember MVC and assemble a new way of understanding Ember which I think is much more effective than the default interpretation, and will make it much easier for you to reason about your Ember apps.

Basically, I figured out Ember so you won't have to. Many people who think Ember's Controllers are not real controllers are left helpless and baffled to explain what Ember's Controllers really are, but I think my book makes that question very easy to answer. So you can skip that whole confusion phase and jump right into building great apps.

Likewise, there are a few places in Ember where there's more than one way to accomplish a given task, and your job becomes to choose the right method. That can be hard without a good mental model, but not everybody learns well from a theoretical perspective, so, in the section on the {{action}} handler, I re-implement the same functionality several different ways, and compare the implementations.

My book about Ember is obviously the best book about Ember, because it's the only book about Ember, but people have told me that my book about Rails is the best book about Rails, and there are many, many books about Rails.



Update: my mistake, there's a book on Amazon and a book on the way from Manning also. My book might be the best book on Ember anyway, but it might not; I don't know yet.

Update: A review from Ember Watch says my book "is the best book on Ember.js, because it's finished, it's focused, it's fit for purpose, and it's fun."

Saturday, June 15, 2013

Tango Protest