<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <title type="text">Rob Conerys Blog</title>
  <generator uri="http://effectif.com/nesta">Nesta</generator>
  <id>tag:wekeroad.com,2009:/</id>
  
  <link rel="alternate" href="http://wekeroad.com" />
  <subtitle type="text">Ruby on Rails, ASP.NET MVC Web Development</subtitle>
  <updated>2013-05-13T10:00:00-05:00</updated>
  <author>
    <name>Rob Conery</name>
    <uri>http://wekeroad.com</uri>
  </author>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/wekeroad/EeKc" /><feedburner:info uri="wekeroad/eekc" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>wekeroad/EeKc</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry>
    <title>Knowing More Programming Languages Will Make You Smarter</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/PIz2b8ykqmw/knowing-more-programming-languages-will-make-you-smarter" />
    <id>tag:wekeroad.com,2013-05-13:/2013/05/13/knowing-more-programming-languages-will-make-you-smarter</id>
    <content type="html">&lt;p&gt;There's a thought in neuroscience/psychological circles that words are much more than sounds that represent things: they are the abstraction of our higher brain function. Words are language, code is language. Restricting yourself to one or two languages is limiting your cognitive abilities&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/language_map.png'/&gt;&lt;/p&gt;&lt;p&gt;&lt;p&gt;&lt;em&gt;image from &lt;a href="http://visual.ly/network-graph-programming-languages-influence"&gt;http://visual.ly/network-graph-programming-languages-influence&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Words as a Conceptual Map&lt;/h2&gt;

&lt;p&gt;There&amp;#39;s a small bit of setup here - bear with me. &lt;a href="http://www.radiolab.org/2010/aug/09/"&gt;I relistened to one of my favorite RadioLab podcasts (&amp;#39;Words&amp;#39;)&lt;/a&gt; this weekend and had my mind blown, once again. They dug into &lt;strong&gt;what words mean&lt;/strong&gt; to us and, according to the show, words are much more than expression vehicles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Words are the very structure of our higher reasoning&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In other words: &lt;em&gt;if you can&amp;#39;t say it, you can&amp;#39;t think it.&lt;/em&gt; The words themselves are cognitive variables strung together to represent feeling, emotion, memory - abstract things made concrete by the words we put to them.&lt;/p&gt;

&lt;p&gt;High-minded stuff and rather than regurgitate the whole show here - go listen if you haven&amp;#39;t, it&amp;#39;s very good. It left me quite inspired and I wondered if the the ideas in the show could extend to programming languages. Why not? Code is simply syntax laid on top of process that a machine needs to understand... hmmm....&lt;/p&gt;

&lt;p&gt;We tell machines how to think - which directly reflects how we think. Writing code always seemed like such a &amp;quot;machine-y&amp;quot; thing to do, but I think that&amp;#39;s not the case: &lt;strong&gt;Programming languages are true languages&lt;/strong&gt; written for us to describe problems that a machine can understand.&lt;/p&gt;

&lt;p&gt;These languages are stripped of nuance and imbued with functionality (loops, terse conditionals) for a myriad of problems. &lt;em&gt;How well do you speak code?&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;A Thought Experiment&lt;/h2&gt;

&lt;p&gt;Code is language, and how we solve problems with a given programming language directly relates to &lt;strong&gt;how we think in that language&lt;/strong&gt;. This doesn&amp;#39;t seem like an amazing revelation in and of itself - in fact I think you probably already understood this quite well.&lt;/p&gt;

&lt;p&gt;But what if we reversed it? What if you couldn&amp;#39;t think any other way - other than what that language &lt;em&gt;allowed you to think&lt;/em&gt;. What if your coding language of choice &lt;strong&gt;was the abstraction over your programming thought process&lt;/strong&gt; - that you actually lacked the mental faculties that lie outside of what that language can represent?&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s say you walk into an interview and you get hit with a classic interview question (no, not FizzBuzz): &lt;strong&gt;write a routine that spits out Fibonacci numbers&lt;/strong&gt;. It&amp;#39;s something every dev has had to do at some point.&lt;/p&gt;

&lt;p&gt;Now, slow your brain down and rewind. What language are you using to express this? What is that language &lt;strong&gt;allowing you to do&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If the only programming language you know is C# you&amp;#39;re probably writing some LINQ in your mind and running a modulus. If you use Javascript you&amp;#39;re probably doing something similar but maybe spread over two functions utilizing callbacks. &lt;/p&gt;

&lt;p&gt;Rubyists out there might do something similar - favoring a more idiomatic approach with blocks/yield rather than a terse one-liner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now write it using a Monad&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recursion?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#39;m sure a few of my readers could do all the above (LINQ, callbacks/blocks, Monad and Recursion) but I doubt that most of you can. This is due to the languages you know, the idioms they use, and &lt;strong&gt;the way those languages allow you to think about a problem&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;Expanding Your Thought Process&lt;/h2&gt;

&lt;p&gt;I don&amp;#39;t know anything about monads but I&amp;#39;ve done recursive programming in the past (sometimes not-intentionally). When I started using Ruby, I began to value the idiom of passing control back and forth using blocks and yield. You can do this in many languages - but for some reason it wasn&amp;#39;t something I routinely did in C#.&lt;/p&gt;

&lt;p&gt;The asynchronous nature of Javascript has awakened a part of my mind to evented programming. Again you can do this in many languages but it&amp;#39;s idiomatic in Javascript and Node.&lt;/p&gt;

&lt;p&gt;I can &amp;quot;think&amp;quot; in these terms and solve problems in ways I could never do when I knew only one language well (C#). At the time I liked the idea of &amp;quot;going deep&amp;quot; - of knowing a language so thoroughly that I could solve any problem with it and not clutter my mind with the different syntaxes of other languages.&lt;/p&gt;

&lt;p&gt;I&amp;#39;m glad I didn&amp;#39;t. And listening to that Radiolab podcast this last weekend made me understand why. I used to think it was that learning new languages would help me &amp;quot;think differently&amp;quot; but now I know it&amp;#39;s more than that: &lt;strong&gt;I&amp;#39;m smarter now&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I&amp;#39;m not an egotistical guy and it hurts a bit to write that last paragraph - as if I&amp;#39;m suggesting that I&amp;#39;m smarter than people who know only one programming language - &lt;strong&gt;which is clearly not true&lt;/strong&gt;. My point is only that &lt;em&gt;I&amp;#39;m smarter than I was 4 years ago&lt;/em&gt; and the reason I think that is because I can solve problems in more ways than I could before and if my definition of &amp;quot;intellect&amp;quot; is accurate...&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/intellect.png" alt="Definition of &amp;#39;Intellect&amp;#39;"&gt;&lt;/p&gt;

&lt;p&gt;... then yeah: I think it&amp;#39;s OK to say I&amp;#39;m smarter than I was with respect to programming.&lt;/p&gt;

&lt;p&gt;The thing I enjoy most about all of this is that I would never have thought about this until I heard that Radiolab podcast. They put the words to the very idea that words are our higher reasoning.&lt;/p&gt;

&lt;p&gt;A lovely bit of recursive fun.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Would I have recognized that recursion a few years ago? Hmmmm....&lt;/strong&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PIz2b8ykqmw:WP2nGYIY1mU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PIz2b8ykqmw:WP2nGYIY1mU:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=PIz2b8ykqmw:WP2nGYIY1mU:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PIz2b8ykqmw:WP2nGYIY1mU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=PIz2b8ykqmw:WP2nGYIY1mU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PIz2b8ykqmw:WP2nGYIY1mU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=PIz2b8ykqmw:WP2nGYIY1mU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/PIz2b8ykqmw" height="1" width="1"/&gt;</content>
    <published>2013-05-13T10:00:00-05:00</published>
    <updated>2013-05-13T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/05/13/knowing-more-programming-languages-will-make-you-smarter</feedburner:origLink></entry>
  <entry>
    <title>Vim: The Alpha and Omega</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/S7Y_jH8HtTE/vim-the-alpha-and-omega" />
    <id>tag:wekeroad.com,2013-04-28:/2013/04/28/vim-the-alpha-and-omega</id>
    <content type="html">&lt;p&gt;I love experimenting with text editors and occasionally IDEs. In the last 6 months I've used no less than 5 different ones... each time I learn just how valuable Vim is to me.&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/vim-commands.jpg'/&gt;&lt;/p&gt;&lt;p&gt;&lt;p&gt;&lt;i&gt;image from &lt;a href="http://jonathanpberger.wordpress.com/2011/02/06/vi-tutorial-for-dvorak-typists/"&gt;http://jonathanpberger.wordpress.com/2011/02/06/vi-tutorial-for-dvorak-typists/&lt;/a&gt;&lt;/i&gt;&lt;/p&gt;

&lt;h2&gt;Skillz&lt;/h2&gt;

&lt;p&gt;Consider: &lt;strong&gt;if you&amp;#39;re a coder you type for a living&lt;/strong&gt;. Code, email, docs - whatever. One of the biggest 
efficiency gains you can achieve is to &lt;strong&gt;become a faster editor&lt;/strong&gt;. This is what Vim does best: help you edit Faster, Better, Stronger - and you can carry these skills with you to almost any editor available today.&lt;/p&gt;

&lt;p&gt;Notice I didn&amp;#39;t say that Vim makes you a &amp;quot;faster typer&amp;quot; - no a faster Editor. Modern IDEs have focused on that of late - and no one is better at it than JetBrains.&lt;/p&gt;

&lt;p&gt;For the last 4 months I&amp;#39;ve been using &lt;a href="http://www.jetbrains.com/ruby/"&gt;RubyMine&lt;/a&gt; and &lt;a href="http://www.jetbrains.com/webstorm"&gt;WebStorm&lt;/a&gt; and have fallen in love with them. WebStorm especially - if you&amp;#39;re a Javascript person (Node or whatever) - it&amp;#39;s a great deal at $49.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.jetbrains.com/webstorm/whatsnew/screenshots/60/html5outline.png" alt="WebStorm"&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#39;m not an intellisense person (since moving my focus away from .NET) but I do find it extremely helpful when working with new libraries. For instance: the Angular plugin for WebStorm helped me explore many of the &amp;quot;ng-&amp;quot; tags that I would not have seen otherwise.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/angular-plugin.png" alt="Angular Plugin"&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;a href="http://tekpub.com/productions/angular"&gt;Tekpub Angular Series&lt;/a&gt; I&amp;#39;ve been using WebStorm exlclusively and I&amp;#39;ve really enjoyed it.&lt;/p&gt;

&lt;p&gt;Both RubyMine and WebStorms have interesting navigation schemes (I think this extends to Resharper for VS too):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cmd-O allows you to search by a class name&lt;/li&gt;
&lt;li&gt;Cmd-Shift-O allows you to search by file name&lt;/li&gt;
&lt;li&gt;Cmd-Option-O allows you to search by symbol (a method name, for instance)&lt;/li&gt;
&lt;li&gt;Cmd-B takes you to a class or method declaration directly&lt;/li&gt;
&lt;li&gt;In the gutter of a Rails project are &amp;quot;go to view&amp;quot; (when you&amp;#39;re in a Controller) and &amp;quot;go to Controller&amp;quot; when you&amp;#39;re in a view&lt;/li&gt;
&lt;li&gt;Cmd-E opens a popup of recently edited files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Really helpful stuff. In addition there are some great inspection features that offer &amp;quot;squigglies&amp;quot; (as Hanselman calls them) when methods aren&amp;#39;t found, script files don&amp;#39;t exist, etc. If you trust it - the editor will also give you refactoring options for your code...&lt;/p&gt;

&lt;p&gt;These are helpful features - but are they helping me edit code faster? In some ways yes... in other ways...&lt;/p&gt;

&lt;h2&gt;Enter Vim&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://codeofrob.com"&gt;Rob Ashton&lt;/a&gt; was out here in Hawaii visiting recently and he is a devoted Vim user. I was showing him WebStorm and all the neat things that go with it - but both of us agreed that we could code faster in Vim.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;&lt;strong&gt;Note&lt;/strong&gt;: I know there are Vim plugins for JetBrains bits (and most other IDEs) - I&amp;#39;ll get there.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;While recording a video &lt;a href="http://us2.campaign-archive1.com/?u=5e6e923ae72e1d1815a5df825&amp;amp;id=40b9d577bd&amp;amp;e="&gt;for our upcoming &amp;quot;Career Reboot&amp;quot; production at Tekpub&lt;/a&gt;, I asked Rob &amp;quot;what tools do you take with you while you hop the globe, journeyman coding&amp;quot;?&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/reboot.jpg" alt="Tekpub&amp;#39;s Career Reboot"&gt;&lt;/p&gt;

&lt;p&gt;For the last year or so &lt;strong&gt;Rob has been travelling the planet&lt;/strong&gt;, working on various projects for a few weeks at a time. His experiment was a simple one:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pay for my travel, lodging and food and I&amp;#39;ll do the work for free&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With him was &lt;strong&gt;a single bag for his clothes and a backpack with 2 computers&lt;/strong&gt;. He gave up his house and all of his furniture and put a few small things in storage and then set out - ending his journey here in Hawaii.&lt;/p&gt;

&lt;p&gt;His work was varied and he wasn&amp;#39;t sure for than a month at a time where he&amp;#39;d be next. Aside from the practical aspect - how do you prepare your machine for working in projects ranging from .NET to C++, Ruby to JavaScript. Rob hate&amp;#39;s VMs as well - preferring to work on the native OS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;He has one Windows Machine and one Mac&lt;/strong&gt;. He wiped OSX off his Mac, however, and installed Ubuntu...&lt;/p&gt;

&lt;p&gt;So what does Rob rely on for writing code?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Vim&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For much of the code he writes, Vim will suffice, everytime. He can load up any set of plugins he needs to write effectively in Ruby, Javascript or Python. He knows the commands well and to watch him use the editor is a fascinating treat.&lt;/p&gt;

&lt;p&gt;When working in Visual Studio, he uses &lt;a href="http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329"&gt;the VsVim plugin&lt;/a&gt; and, according to him:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If I didn&amp;#39;t have these Vim plugins for VisualStudio I&amp;#39;d be screwed&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most IDEs have a Vim &amp;quot;overlay&amp;quot;. All of the JetBrains IDEs do, and so does SublimeText and ... well just about any editor you can think of.&lt;/p&gt;

&lt;h2&gt;Vim, Everywhere&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;In terms of editing code, Vim won.&lt;/strong&gt; The eternal Vim/Emacs war will rage on forever - but I don&amp;#39;t think anyone can argue that, &lt;strong&gt;in terms of pure editing power: Vim does what it does, extremely well&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;From your new shiny Mac Air to the Linux box in the cloud somewhere: open the terminal and hit &amp;quot;vim&amp;quot; and it&amp;#39;s likely there, ready to edit config files or code. &lt;strong&gt;Vim is the Alpha and Omega editor&lt;/strong&gt; - the beginning and the end. &lt;strong&gt;Vim is everywhere&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;So it&amp;#39;s back to Vim for me&lt;/em&gt;. I like the JetBrains tools and I enjoy SublimeText 2 a lot... but I can move and edit in Vim at twice the speed. &lt;/p&gt;

&lt;p&gt;You might be wondering: &lt;strong&gt;&amp;quot;why not just use a Vim plugin dude?&amp;quot;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The inspections, plugins and &amp;quot;helper&amp;quot; functions in the JetBrains tools are interesting and helpful, &lt;strong&gt;but they come at a price&lt;/strong&gt; (to me). It slows down the IDE, slows down typing, and many times it offers things I just don&amp;#39;t want (like spelling corrections in my HTML files).&lt;/p&gt;

&lt;p&gt;Often-times I feel like I spent an increasing amount of time diddling with the IDE more than the code. Looking up shortcuts, setting up configurations for testing, running and debugging... when I know how to do this already &lt;strong&gt;without the slick interface&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I like a pretty coding surface. I appreciate clean font rendering and seeing a project tree with all my code files and a fast, fuzzy file-finding feature. &lt;em&gt;And I can get all of that with Vim&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I proved that to myself yesterday when editing a Rails project. Leader-P brought up &lt;a href="https://peepcode.com/products/peepopen"&gt;PeepOpen&lt;/a&gt;, &lt;code&gt;&amp;quot;/mailto&amp;quot;&lt;/code&gt; took me to a broken mail link. &lt;code&gt;&amp;quot;c4w mailto:support&amp;quot;&lt;/code&gt;and the broken email was fixed. &lt;code&gt;RController pro[tab]&lt;/code&gt; and I&amp;#39;m editing the ProductsController...&lt;/p&gt;

&lt;p&gt;My Vim-glee was broken, however, when I realized I had forgotten the syntax for ActiveRecords eager-loading feature (include, include?, includes). Uh oh.&lt;/p&gt;

&lt;p&gt;Rob put it very well when discussing IDEs:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If a tool starts thinking for me, starts remembering the syntax that I need to write... I&amp;#39;ll forget the code and start becoming reliant on that tool to do my work for me.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This has happened to me ... quite often. When I was working in .NET it was nearly impossible for me to free-hand (without intellisense) simple structures like lambdas or a generic class definition using an interface. It&amp;#39;s a syntax-heavy language and I can see how intellisense helps you with it.&lt;/p&gt;

&lt;p&gt;The thing you lose, however, is &lt;em&gt;thinking in that language&lt;/em&gt;. When the syntax is ready in your brain, you can &lt;strong&gt;think in code&lt;/strong&gt; and sidestep the translation through the editor.&lt;/p&gt;

&lt;p&gt;This is where Vim shines most and languages like Ruby flex their expressive muscle. &lt;strong&gt;You think the code, Vim expresses it directly&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The best part? You don&amp;#39;t need to be using Vim to use Vim. Drop a plugin in a JetBrains IDE or Visual Studio and you&amp;#39;re off (if you need to use those tools for whatever reason).&lt;/p&gt;

&lt;p&gt;You never know, one day you might need to work in Clojure in Vilnius... &lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=S7Y_jH8HtTE:ROmOmOZ4FDU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=S7Y_jH8HtTE:ROmOmOZ4FDU:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=S7Y_jH8HtTE:ROmOmOZ4FDU:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=S7Y_jH8HtTE:ROmOmOZ4FDU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=S7Y_jH8HtTE:ROmOmOZ4FDU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=S7Y_jH8HtTE:ROmOmOZ4FDU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=S7Y_jH8HtTE:ROmOmOZ4FDU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/S7Y_jH8HtTE" height="1" width="1"/&gt;</content>
    <published>2013-04-28T10:00:00-05:00</published>
    <updated>2013-04-28T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/04/28/vim-the-alpha-and-omega</feedburner:origLink></entry>
  <entry>
    <title>Models and Services in Angular</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/VvpPVADxNBA/models-and-services-in-angular" />
    <id>tag:wekeroad.com,2013-04-25:/2013/04/25/models-and-services-in-angular</id>
    <content type="html">&lt;p&gt;It can be confusing when trying to structure a client-side application, especially when it comes to separating models from controllers and services. Doing this in Angular means diving into some details.&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/rocket_builder.jpg'/&gt;&lt;/p&gt;&lt;p&gt;&lt;p&gt;&lt;i&gt;Image from &lt;a href="http://union-bulletin.com/news/2012/aug/03/one-part-science-one-part-excitement-equal-success/"&gt;http://union-bulletin.com/news/2012/aug/03/one-part-science-one-part-excitement-equal-success/&lt;/a&gt;&lt;/i&gt;&lt;/p&gt;

&lt;h2&gt;What&amp;#39;s a Model? What&amp;#39;s a Service?&lt;/h2&gt;

&lt;p&gt;I read over a post by Joel Hooks today called &lt;a href="http://joelhooks.com/blog/2013/04/24/modeling-data-and-state-in-your-angularjs-application/"&gt;Modeling Data and State in Your AngularJS Application&lt;/a&gt; and the idea was put forward that you can clean up your Controllers by (basically) using Angular&amp;#39;s service as a model.&lt;/p&gt;

&lt;p&gt;The idea is a good one: &lt;strong&gt;Clean Controllers are Godly Controllers&lt;/strong&gt; but there&amp;#39;s some confusion in the post that I think will end up spreading.&lt;/p&gt;

&lt;p&gt;Straight up-front: &lt;strong&gt;All services (service(), factory(), provider()) in Angular are SINGLETONS&lt;/strong&gt;. It&amp;#39;s difficult under any circumstances to consider a Singleton as a model.&lt;/p&gt;

&lt;p&gt;There are so many jargon-filled terms disseminated throughout different approaches to software design... but I think we can agree that a model is representative of data (as opposed to a Domain Model which is all of your stuff under a big umbrella).&lt;/p&gt;

&lt;p&gt;In the post above, Joel has a list of authors and a quote from each one - a simple data structure:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fowler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Fowler&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Any fool can write code that a computer can understand. Good programmers write code that humans can understand.&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;twain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Twain&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Why, I have known clergymen, good men, kind-hearted, liberal, sincere, and all that, who did not know the meaning of a &amp;#39;flush.&amp;#39; It is enough to make one ashamed of one&amp;#39;s species.&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;One might consider this list to be two instances of a single Model, Author:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;Author&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;atts&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;initialSettings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;atts&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//initial settings if passed in&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;setting&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;initialSettings&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;initialSettings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hasOwnProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;setting&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;setting&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;initialSettings&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;setting&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//with some logic...&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fullName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//return the scope-safe instance&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;self&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Translating this to Joel&amp;#39;s code:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fowler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Fowler&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Any fool can write code that a computer can understand. Good programmers write code that humans can understand.&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}),&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;twain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Twain&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Why, I have known clergymen, good men, kind-hearted, liberal, sincere, and all that, who did not know the meaning of a &amp;#39;flush.&amp;#39; It is enough to make one ashamed of one&amp;#39;s species.&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;So far, so good. Unfortunately I think some confusion crept in - here is the full example of Joel&amp;#39;s code for his authorListModel:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;span class='line-number'&gt;19&lt;/span&gt;
&lt;span class='line-number'&gt;20&lt;/span&gt;
&lt;span class='line-number'&gt;21&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;angular&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;modelDemo&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;authorListModel&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;$rootScope&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$rootScope&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fowler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;              &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Fowler&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;              &lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Any fool can write code that a computer can understand. Good programmers write code that humans can understand.&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="nx"&gt;twain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;              &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Twain&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;              &lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Why, I have known clergymen, good men, kind-hearted, liberal, sincere, and all that, who did not know the meaning of a &amp;#39;flush.&amp;#39; It is enough to make one ashamed of one&amp;#39;s species.&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="c1"&gt;//...&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;fowler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;twain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;poe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;plato&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedAuthor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setSelectedAuthor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;              &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedAuthor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;              &lt;span class="nx"&gt;$rootScope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$broadcast&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;authorModel::selectedAuthorUpdated&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}]);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;In the first line we&amp;#39;ve told Angular that this function is to be used a Service. Services in Angular are Singletons - which can cause all kinds of interesting headaches if you treat that service as a Model.&lt;/p&gt;

&lt;p&gt;In Joel&amp;#39;s case there&amp;#39;s nothing wrong with the code here - except that it&amp;#39;s not a Model - &lt;strong&gt;it&amp;#39;s a Service&lt;/strong&gt; and before you think I&amp;#39;m nitpicking - &lt;strong&gt;Service, in Angular, has a very particular reason for existence&lt;/strong&gt; and it&amp;#39;s not this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;... the “M” in MVC, model classes encapsulate your application’s data and provide an API to access and manipulate that data. The other classes in your application will make requests of models via this API. When data on the model is updated, the model dispatches events that the other classes within your application can react to.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The definition is a good one - unfortunately the code that is being offered to support the definition is actually a Service, not a Model.&lt;/p&gt;

&lt;h2&gt;So What About a Model?&lt;/h2&gt;

&lt;p&gt;I get asked this a fair amount and my answer is typically:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your model lives on the server&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;i&gt;hat-tip to Steve Sanderson for this&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;This works in many ways: it frees you from duplicating code on the client and it keeps secret things secret (such as applying discounts to a shopping cart, etc).&lt;/p&gt;

&lt;p&gt;But what about behavior on individual bits of data? Here&amp;#39;s where things get interesting with Angular.&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s say you use Angular&amp;#39;s $resource to hook up to an Author resource in the sky somewhere:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;angular&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;authorApp&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;api&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$resource&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;authors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$resource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/authors&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Api&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;You can use this in your controller like so:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;AuthorCtrl&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//returns [{first : &amp;#39;Mark&amp;#39;, last : &amp;#39;Twain&amp;#39;, quote : &amp;#39;...&amp;#39;}]&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;authors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;authors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;That will send a GET request off to &amp;quot;/authors&amp;quot; and return a promise that will provide some data on success. Angular works really well with promises so there&amp;#39;s no more code to be written here - when the data shows up, it hits the $scope which is &amp;quot;bound&amp;quot; to the UI through ng-repeat and off we go. &lt;/p&gt;

&lt;p&gt;But how can we use our Author prototype above? A number of ways - let&amp;#39;s go through this...&lt;/p&gt;

&lt;p&gt;The first way is to get away from using &amp;quot;service&amp;quot; and have a bit more structure with a factory:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;span class='line-number'&gt;19&lt;/span&gt;
&lt;span class='line-number'&gt;20&lt;/span&gt;
&lt;span class='line-number'&gt;21&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;angular&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;authorApp&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;api&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$resource&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;authorResource&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;$resource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/authors&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;queryAuthors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="c1"&gt;//use a callback instead of a promise&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;authorResource&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;({},&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//Underscore&amp;#39;s &amp;quot;each&amp;quot; method&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;each&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="c1"&gt;//using our Author prototype above&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;          &lt;span class="nx"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Author&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;authors&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;queryAuthors&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Api&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;A bit more code... but either way we can use it this way:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;AuthorCtrl&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//returns [{first : &amp;#39;Mark&amp;#39;, last : &amp;#39;Twain&amp;#39;, quote : &amp;#39;...&amp;#39;}]&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;Api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;authors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;authors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Now we have a nice array of Authors. But we&amp;#39;ve also bent Angular just a bit because we&amp;#39;re thinking like Software Developers - expecting &amp;quot;behavior&amp;quot; like &amp;quot;fullName()&amp;quot; to be on our model.&lt;/p&gt;

&lt;p&gt;If we take a step back and consider what we&amp;#39;re doing here (instrumenting the UI) - that doesn&amp;#39;t make all that much sense. Here&amp;#39;s where Joel and I will increase our disagreement :) and maybe you&amp;#39;ll think I&amp;#39;m a dope.&lt;/p&gt;

&lt;h2&gt;Domain vs. Presentation Concerns&lt;/h2&gt;

&lt;p&gt;What is the motive for using the Author prototype? Typically, when working with Single Page Applications it&amp;#39;s something that relates to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code Reuse (Author might be reusable around the app)&lt;/li&gt;
&lt;li&gt;Centralized Logic (fullName(), daysUntilBirthday())&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&amp;#39;m going to put forward a bit of a strong opinion: &lt;strong&gt;if it&amp;#39;s not presentation-related, it doesn&amp;#39;t belong here&lt;/strong&gt;. Hopefully we can agree on this as, well, the page is all about presentation and while yes there&amp;#39;s logic flying around - it&amp;#39;s presentation logic!&lt;/p&gt;

&lt;p&gt;Angular provides a better facility for this kind of thing: &lt;strong&gt;they&amp;#39;re called filters&lt;/strong&gt;. In Angular we can do this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fullNameFilter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="c1"&gt;//you can have some logic in here to introspect &amp;quot;person&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="c1"&gt;//for &amp;quot;first&amp;quot; or &amp;quot;firstName&amp;quot; or whatever&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;last&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;//add it to the app&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;fullname&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fullNameFilter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;In your code you can now ask for the full name like this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;ng-repeat=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;author in authors&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ author | fullname}}&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;The really nice thing about this is that you can reuse these filters - in any project! Turning this back to Joel&amp;#39;s post - can we solve the problem without introducing a new model/service?&lt;/p&gt;

&lt;p&gt;I think so. In looking at the controller code that Joel wants to refactor, we see this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;twain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fowler&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;poe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;plato&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectQuote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedQuote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedAuthor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isSelected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;author&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;author&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selectedAuthor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;I can guess as to a few reasons why it exists - but I don&amp;#39;t think it&amp;#39;s going out on a limb to think Joel wants to indicate visually which author the user wants to know more about.&lt;/p&gt;

&lt;p&gt;There are a number of ways to solve this - from drop dead simple:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;ng-repeat=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;author in authors&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="c"&gt;&amp;lt;!--select the author, then set the class or whatever is needed. Yay dynamic languages!--&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;checkbox&amp;#39;&lt;/span&gt; &lt;span class="na"&gt;ng-model=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;author.selected&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    {{fullname | author}}
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;To a more advanced solution involving directives (which I&amp;#39;ll sidestep for now - this post is long enough). My ultimate point is that we&amp;#39;re in presentation land here and while it&amp;#39;s tempting to put your engineering muscle to work, there&amp;#39;s just no need.&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=VvpPVADxNBA:TBLWnc4G7rk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=VvpPVADxNBA:TBLWnc4G7rk:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=VvpPVADxNBA:TBLWnc4G7rk:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=VvpPVADxNBA:TBLWnc4G7rk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=VvpPVADxNBA:TBLWnc4G7rk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=VvpPVADxNBA:TBLWnc4G7rk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=VvpPVADxNBA:TBLWnc4G7rk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/VvpPVADxNBA" height="1" width="1"/&gt;</content>
    <published>2013-04-25T10:00:00-05:00</published>
    <updated>2013-04-25T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/04/25/models-and-services-in-angular</feedburner:origLink></entry>
  <entry>
    <title>Ember... What If (Part 1)</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/rEbegmNcGV8/ember-what-if-part-1" />
    <id>tag:wekeroad.com,2013-03-23:/2013/03/23/ember-what-if-part-1</id>
    <content type="html">&lt;p&gt;The Ember guys are having a hard week. I promised Tom Dale I'd try and help by "arm-waving" an API together that I feel expresses a bit more about the main ideas behind Ember. It's Friday, I've had a beer or two... but I got inspired...&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/thinker.jpg'/&gt;&lt;/p&gt;&lt;p&gt;&lt;p&gt;&lt;em&gt;image from &lt;a href="http://therustyshield.wordpress.com/2011/09/02/breakfast-topic-how-long-do-you-take-to-create-a-character/thinker/"&gt;The Rusty Shield&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Hello There!&lt;/h2&gt;

&lt;p&gt;Setting a happy tone immediately is job one, in my mind. When you add Ember to a page you want to know it&amp;#39;s there, and it&amp;#39;s ready for you. Moreover you want to get going writing some code!&lt;/p&gt;

&lt;p&gt;Right now you&amp;#39;re stopped immediately with script warnings about including Handlebars and jQuery (if you don&amp;#39;t have them installed). Can we make that experience better?&lt;/p&gt;

&lt;p&gt;Yes. Bundle them! Angular bundles jQlite, Ember should bundle Handlebars and the same library. If they can&amp;#39;t do that (for whatever reason): &lt;strong&gt;tell me&lt;/strong&gt; (using console.log): &lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;Ember needs Handlebars and jQuery to run! You can download them directly or just use add these tags above the ember.js script tag:
&lt;/span&gt;&lt;span class='line'&gt;&amp;lt;script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.min.js"&amp;lt;/script&amp;gt;
&lt;/span&gt;&lt;span class='line'&gt;&amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;How nice is that! I still like the idea of bundling, however.&lt;/p&gt;

&lt;h2&gt;Default App.&lt;/h2&gt;

&lt;p&gt;Ember is all about convention. Convention with naming, with various objects following MVC - what if we flexed that even more.&lt;/p&gt;

&lt;p&gt;The assumption is this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you include Ember, you want to build a Javascript application&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think that&amp;#39;s a pretty solid assumption. So let&amp;#39;s turn this around - instead of writing this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Just make &amp;quot;App&amp;quot; exist already! We know that jQuery is a dependency - so go with it and load that statement up by default:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;//Part of Ember.js&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;This can be overriden (which keeps in the spirit of Ember) in a new method &lt;code&gt;Ember.bootstrap&lt;/code&gt;:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;Tekpub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MyApp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//config etc.&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;For me, 9 times out of 10 I&amp;#39;ll just work with &amp;quot;App&amp;quot;. No need to change things in my mind and if you need to - just run &lt;code&gt;App.config(function(app){})&amp;quot;&lt;/code&gt; and change things in &lt;code&gt;$(document).ready()&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;That Naming Thing&lt;/h2&gt;

&lt;p&gt;Right now there are a lot of concepts that hang loosely from a naming scheme. This is a double-whammy that I think makes Ember hard to use.&lt;/p&gt;

&lt;p&gt;What if we reversed this entirely? What if we defined the &amp;quot;name&amp;quot; up front? Here&amp;#39;s what the Index definition would be (it could easily be &amp;quot;Post&amp;quot; or something else):&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;span class='line-number'&gt;16&lt;/span&gt;
&lt;span class='line-number'&gt;17&lt;/span&gt;
&lt;span class='line-number'&gt;18&lt;/span&gt;
&lt;span class='line-number'&gt;19&lt;/span&gt;
&lt;span class='line-number'&gt;20&lt;/span&gt;
&lt;span class='line-number'&gt;21&lt;/span&gt;
&lt;span class='line-number'&gt;22&lt;/span&gt;
&lt;span class='line-number'&gt;23&lt;/span&gt;
&lt;span class='line-number'&gt;24&lt;/span&gt;
&lt;span class='line-number'&gt;25&lt;/span&gt;
&lt;span class='line-number'&gt;26&lt;/span&gt;
&lt;span class='line-number'&gt;27&lt;/span&gt;
&lt;span class='line-number'&gt;28&lt;/span&gt;
&lt;span class='line-number'&gt;29&lt;/span&gt;
&lt;span class='line-number'&gt;30&lt;/span&gt;
&lt;span class='line-number'&gt;31&lt;/span&gt;
&lt;span class='line-number'&gt;32&lt;/span&gt;
&lt;span class='line-number'&gt;33&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//wrap the notion of an Index in a &amp;quot;Definition&amp;quot; object&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//this is clean, and in one place&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="c1"&gt;//the naming concerns are implied&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="c1"&gt;//all of the below is optional&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//this is an Ember.Data thing&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//or I can override some methods using&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//my own Ajax stuff with jQuery&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;routes&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="s2"&gt;&amp;quot;/:thingy&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="s2"&gt;&amp;quot;/stuff&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="s2"&gt;&amp;quot;another-override&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;controller&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;routeParameters&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//route params are available via route.thingy, etc&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//this function is optional and exists for you&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//created by Ember&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//this method is available in my view&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;        &lt;span class="c1"&gt;//fetch from the model and return the result&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="c1"&gt;//another...&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;comments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;        &lt;span class="c1"&gt;//etc&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;The view is just a script tag with the id &amp;quot;index&amp;quot; in keeping with the spirit of Ember. In the view I can use all the same templating and expect to use whatever method/data that I&amp;#39;ve declared on my controller.&lt;/p&gt;

&lt;p&gt;The nice thing about this setup is that I&amp;#39;m using the model as a separate idea - it&amp;#39;s not magically melded to my controller and it keeps the concepts a bit cleaner (to me).&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s put the name first and formalize the overrides in a single place. This is how I think about things, at least, and it would be nice to see it all in one place.&lt;/p&gt;

&lt;h2&gt;A Little Help?&lt;/h2&gt;

&lt;p&gt;OK, You&amp;#39;ve installed Ember after reading a tutorial. You&amp;#39;ve seen a post with the API above and you want to get started writing some code.&lt;/p&gt;

&lt;p&gt;Ember has created the App for you, but it doesn&amp;#39;t have a View:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;Ember&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;installed&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;ready&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;go&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;The&lt;/span&gt; &lt;span class="nx"&gt;first&lt;/span&gt; &lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;create&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;view&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;text/x-handlebars&amp;quot;&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;application&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;Put&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;tag&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="nx"&gt;where&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;want&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;see&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Nice - you copy paste that into your HTML page, and the next thing you see is...&lt;/p&gt;

&lt;div class='well'&gt;
  &lt;h2&gt;Hello, Welcome To Ember&lt;/h2&gt;
  &lt;p&gt;This is your Index space and you can override me by defining an index template:&lt;/p&gt;
  &lt;pre&gt;&lt; script type="text/x-handlebars" data-template-name="index"&gt;&lt;/ script &gt;&lt;/pre&gt;
  &lt;/p&gt;
  &lt;p&gt;... and overriding App.Index:&lt;/p&gt;
  &lt;pre&gt;&lt;code&gt;
App.Index = function(){
  return {
    //the code you see above
  }
}
  &lt;/code&gt;&lt;/pre&gt;
  &lt;p&gt;
    You can read the &lt;a href='#'&gt;Documentation on what this is here&lt;/a&gt;.
  &lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Not only did Ember create an &lt;code&gt;App&lt;/code&gt; for us - it also created a default Index &amp;quot;space&amp;quot; if you will. That Index defaulted to a nice helpful message on what to do next.&lt;/p&gt;

&lt;h2&gt;Arm Waving&lt;/h2&gt;

&lt;p&gt;That&amp;#39;s what this is. I might be completely crazy, I might utterly misunderstand what Ember is trying to do.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ll tell you this, however: &lt;strong&gt;if this is the way Ember crafted their API, I&amp;#39;d love it.&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So there it is! I like being constructive when I can - hopefully this helps the team :).&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=rEbegmNcGV8:qHi1k0SsVbs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=rEbegmNcGV8:qHi1k0SsVbs:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=rEbegmNcGV8:qHi1k0SsVbs:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=rEbegmNcGV8:qHi1k0SsVbs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=rEbegmNcGV8:qHi1k0SsVbs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=rEbegmNcGV8:qHi1k0SsVbs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=rEbegmNcGV8:qHi1k0SsVbs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/rEbegmNcGV8" height="1" width="1"/&gt;</content>
    <published>2013-03-23T10:00:00-05:00</published>
    <updated>2013-03-23T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/03/23/ember-what-if-part-1</feedburner:origLink></entry>
  <entry>
    <title>Hell... Is Other People</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/ZagFlqH-NhI/hell-is-other-people" />
    <id>tag:wekeroad.com,2013-03-22:/2013/03/22/hell-is-other-people</id>
    <content type="html">&lt;p&gt;Get up from your desk or chair or floor and go for a walk. Right now - I challenge you to do this. If you can walk through a crowded place - that's even better. Go by yourself, and soak it in... all of it...&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/hell_other_people.jpg'/&gt;&lt;/p&gt;&lt;p&gt;&lt;p&gt;&lt;em&gt;image from &lt;a href="http://venndiagrams.tumblr.com/post/1269983588/robotrobotrobot-hell-is-other-people-venn"&gt;venndiagrams.tumblr.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;Garrett Is A JERK&lt;/h2&gt;

&lt;p&gt;It&amp;#39;s 7:40am and I&amp;#39;m sitting outside my office with a warm, steamy cup of my favorite roast from Hanalei Roasting company. It&amp;#39;s the perfect shade of rich, deep oakey-brown that tells me I hit the right mixture of milk and sugar.&lt;/p&gt;

&lt;p&gt;I&amp;#39;m looking over the hills from the upstairs walkway in front of my office door. Behind me, the door is open and work is waiting for me... in front of me the sun is poking through the golden morning clouds and the dew from the damp air is everywhere. &lt;/p&gt;

&lt;p&gt;It&amp;#39;s quiet, and I&amp;#39;m loving it. &lt;strong&gt;Until Garrett entered my life&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Well, it was Garrett&amp;#39;s girlfriend, actually. It started with a low, shrill sound that came from around the parking lot. It was muffled somewhat but it sounded like someone in trouble. Naturally I looked around, thinking someone might need my help.&lt;/p&gt;

&lt;p&gt;Then all of a sudden the volume increased dramatically as she got out of her car. She was in full hysterics, yelling into the phone about how Garrett was a FUCKING PIECE OF SHIT JERK ASSHOLE etc. etc.&lt;/p&gt;

&lt;p&gt;She stood there for about 30 seconds in the parking lot that was filling with cars as people came to work. They walked past her, careful not to look. &lt;/p&gt;

&lt;p&gt;After a while she slammed the door of her car and stormed upstairs. She works in the office next to mine. I decided to give her some space so I went inside and shut the door. She decided to stay outside and vent her rage over the entire parking lot, into the golden sunrise morning I was just enjoying.&lt;/p&gt;

&lt;p&gt;She stayed there for 20 minutes, then went inside. I got to learn all about Garrett... who apparently is not a very nice person.&lt;/p&gt;

&lt;h2&gt;Yeah Yeah Yeah&lt;/h2&gt;

&lt;p&gt;4 weeks ago I took my family to Kalihiwai Beach where we like to go for barbeques with friends. It was a lovely night, the sun setting much the same way it comes up: golden light poking through swollen, puffed clouds full of warm rain.&lt;/p&gt;

&lt;p&gt;6 of us were sitting around the tailgate of my truck, when right next to us pulls up a black Hummer with blinking blue lights underneath. It&amp;#39;s a high-end &amp;quot;situational&amp;quot; rental car that is completely out of place here, on this beach in Hawaii. It&amp;#39;s an LA ride that looks like the UFO it was apparently dropped from.&lt;/p&gt;

&lt;p&gt;Out of the car comes a 30-something markety/dotcom guy. Thick glasses, tall and in shape. He&amp;#39;s from LA - as am I - and we can smell it on each other. He tips his head back: &amp;quot;SUP&amp;quot;.&lt;/p&gt;

&lt;p&gt;We wave as he reaches back in his car and flips on, full volume, &lt;a href="https://www.youtube.com/watch?v=umAL-6-j1Ew"&gt;one of the worst remixes of one of the best Yeah Yeah Yeahs songs there is&lt;/a&gt;. He opens the door wide - the one that faces us. He then goes to the back door and does the same... and then turns it up with a remote control in his pocket. All... the way... UP.&lt;/p&gt;

&lt;p&gt;My chest thumps as the bass booms from inside. Purple beat-lights glow with the pulse of this horrible song as the trees ring with the echo of cheesy synth loops.&lt;/p&gt;

&lt;p&gt;He&amp;#39;s 20 feet away from us. There are no other cars on this half-mile stretch of beach. He&amp;#39;s got this song on a loop so it plays... continually.&lt;/p&gt;

&lt;p&gt;As opposed to Garrett&amp;#39;s girlfriend, we didn&amp;#39;t stand for it long. My buddy&amp;#39;s wife casually went over and asked them to shut the doors facing us and to ... maybe open the doors facing them (no, really). They did, but not without giving stink eye.&lt;/p&gt;

&lt;h2&gt;Bookended&lt;/h2&gt;

&lt;p&gt;At lunch 3 months ago I sat at a table with a friend from out of town and a couple proceeded to get into a fight next to us. The lady stood up to storm away but thought of something clever so turned around just on the other side of us and, snappily, and let him have it. A lovely insult about his new car, flying right over the top of our heads and into his anger-laden face.&lt;/p&gt;

&lt;p&gt;He fought back, she stayed put. We&amp;#39;re square in the middle. I sat back and just listened - turning my head as if at an emotional tennis match between the two. The guy looked at me as if to say &amp;quot;bug off&amp;quot;, I shrugged with my hands in the air (&amp;quot;where should I go?&amp;quot;)... and they went outside... glaring back at me on the way.&lt;/p&gt;

&lt;h2&gt;CONTEXT&lt;/h2&gt;

&lt;p&gt;So many people are absolutely, stunningly unaware about the little bubble that surrounds them, defined by their thoughts, emotions and words. An interesting (and at the same time scary) thing is that groups of us share these things together - and our bubbles grow as we join into a group.&lt;/p&gt;

&lt;p&gt;We walk around like pachinko balls ... bouncing our bubbles off someone else&amp;#39;s. They either repel, or like bubbles, can join and grow larger. You can manage this process.&lt;/p&gt;

&lt;p&gt;In a room full of other people, you have to manage that bubble of yours quite methodically - especially when you&amp;#39;re with a group of friends having what you think is a private conversation. &lt;strong&gt;It almost never is&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;That person sitting next to you on the bus/train/plane speaking really loudly into their cellphone? The new parents involving the entire restaurant in the little game they&amp;#39;re playing with little Dylan? Or maybe the person in the front of the line who just now thought about looking at the menu and deciding what to eat...&lt;/p&gt;

&lt;p&gt;Awareness. A Good Thing.&lt;/p&gt;

&lt;p&gt;Whatever you&amp;#39;re saying, thinking, emoting - all of it is shared with the people around you to some degree - even if they can&amp;#39;t directly hear you. We&amp;#39;re a sensitive animal and have senses built into us forged by millions of years of survival, intellect, and cunning. To pretend that words alone define meaning is complete folly.&lt;/p&gt;

&lt;p&gt;Joking with your friend in a room full of diverse people isn&amp;#39;t necessarily harmful, until you become blind to your own context as each of the people in the above stories were. Sometimes it doesn&amp;#39;t matter. Other times it does.&lt;/p&gt;

&lt;p&gt;You might be sitting next to someone who&amp;#39;s sitting on an emotional grenade. That clever little joke you just made? It could be about guns, politics, gay marriage... or dongles. Well it might set that grenade off.&lt;/p&gt;

&lt;p&gt;Call it professionalism, politeness, or just Old Fashioned Decency - it&amp;#39;s why these things exist: &lt;strong&gt;so we can get along and avoid atomic swarm tendencies&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Until another person welcomes you into their context - no - you&amp;#39;re not free (socially speaking) to do as you please without consequence. As much as you might feel you&amp;#39;re protected by law to walk naked down the street singing that horrid Yeah Yeah Yeahs remix - your actions have an effect (and consequence) with others.&lt;/p&gt;

&lt;p&gt;The same goes for being upset. Be aware of yourself and just how angry you&amp;#39;ve become. Think about why, and remember you&amp;#39;re in public, around strangers. Think about your actions carefully in the way that the people in the story above did not.&lt;/p&gt;

&lt;p&gt;This doesn&amp;#39;t simply sit along gender lines (saying &lt;a href="http://blog.8thlight.com/uncle-bob/2013/03/22/There-are-ladies-present.html"&gt;There are Ladies Present&lt;/a&gt; is a bit off the mark to me - the issue could as well have been racial or religious). I prefer to think &lt;strong&gt;there are other people present&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The only way to truly avoid the hell that can be other people is to understand the power of your own presence. Believe that you &lt;strong&gt;do&lt;/strong&gt; have an effect on others. &lt;strong&gt;Just make it a positive one&lt;/strong&gt; always.&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=ZagFlqH-NhI:tRZQf2khJVI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=ZagFlqH-NhI:tRZQf2khJVI:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=ZagFlqH-NhI:tRZQf2khJVI:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=ZagFlqH-NhI:tRZQf2khJVI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=ZagFlqH-NhI:tRZQf2khJVI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=ZagFlqH-NhI:tRZQf2khJVI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=ZagFlqH-NhI:tRZQf2khJVI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/ZagFlqH-NhI" height="1" width="1"/&gt;</content>
    <published>2013-03-22T10:00:00-05:00</published>
    <updated>2013-03-22T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/03/22/hell-is-other-people</feedburner:origLink></entry>
  <entry>
    <title>Ember: Baby Steps</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/yMrhlO3kWpI/ember-baby-steps" />
    <id>tag:wekeroad.com,2013-03-20:/2013/03/20/ember-baby-steps</id>
    <content type="html">&lt;p&gt;If you read my blog, you know I've been goofing around with quite a few Javascript libraries. Some are easier than others. This time, it's Ember's turn.&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/ember_get_started.png'/&gt;&lt;/p&gt;&lt;p&gt;&lt;h2&gt;A Bit Steep&lt;/h2&gt;

&lt;p&gt;I figured it&amp;#39;s about time to get constructive in terms of getting to know EmberJS. The only reason I haven&amp;#39;t up until this point is that I&amp;#39;ve been very busy with &lt;a href="http://tekpub.com/productions/angular"&gt;Tekpub&amp;#39;s Angular production&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;So, today&amp;#39;s the day. Let&amp;#39;s get started.&lt;/p&gt;

&lt;h2&gt;Baby Steps&lt;/h2&gt;

&lt;p&gt;Getting Ember setup is frustrating. &lt;a href="http://emberjs.com/guides/"&gt;The Ember guides&lt;/a&gt; are focused heavily on concept, not utility. For instance - getting Ember to load (for the uninitiated) is a matter of refreshing until the errors go away. I&amp;#39;ll save you that time :).&lt;/p&gt;

&lt;p&gt;Kick open a console (if you&amp;#39;re on Linux/Mac) or crack open VS/WebMatrix if you&amp;#39;re on a Windows machine. We want a bare application here so let&amp;#39;s start by creating a directory:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;mkdir hello-ember
&lt;/span&gt;&lt;span class='line'&gt;cd hello-ember&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Now we&amp;#39;re in our directory. Let&amp;#39;s create the pages/directories we&amp;#39;ll need:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;mkdir js
&lt;/span&gt;&lt;span class='line'&gt;touch index.html&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;The next step is to get the scripts we&amp;#39;ll need. We&amp;#39;ll need 3:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;jQuery&lt;/li&gt;
&lt;li&gt;Handlebars&lt;/li&gt;
&lt;li&gt;Ember&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ember won&amp;#39;t work unless you have all three of these. I like to use the jQuery CDN at Google, but you&amp;#39;ll need to &lt;a href="https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-rc.1.js"&gt;download Ember directly&lt;/a&gt; and also &lt;a href="https://raw.github.com/wycats/handlebars.js/1.0.0-rc.3/dist/handlebars.js"&gt;Handlebars&lt;/a&gt;. Put these files in your &lt;code&gt;js&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Be sure to use the unminified version for development. This goes for any library you&amp;#39;re learning - the unminified versions are easy to traverse if you have a debugger, and they typically have helpful debug statements built in.&lt;/p&gt;

&lt;p&gt;Save these files in your &lt;code&gt;js&lt;/code&gt; directory. &lt;/p&gt;

&lt;p&gt;Let&amp;#39;s add one more file where our application code will go:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class=''&gt;&lt;span class='line'&gt;touch js/app.js&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Open up the index.html page and stub out our skeleton, with the script references in place:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Hello Ember&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello Ember&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;js/handlebars.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;js/ember.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;js/app.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Let&amp;#39;s run this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;python -m SimpleHTTPServer
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Things should be cycling &lt;a href="http://localhost:8000"&gt;on port 8000&lt;/a&gt;. If you&amp;#39;re on Windows, just hit F5.&lt;/p&gt;

&lt;p&gt;Now let&amp;#39;s write some Ember code.&lt;/p&gt;

&lt;h2&gt;Step 1: The Application View&lt;/h2&gt;

&lt;p&gt;Up front: there&amp;#39;s a lot of magic that happens behind the scenes with Ember. Just about any tutorial you read will spend 75% of the time explaining the concepts behind Ember, and 25% of the time on actually using it.&lt;/p&gt;

&lt;p&gt;This can be daunting for people who &amp;quot;want to get a feel&amp;quot; (like me) and don&amp;#39;t like sitting through conceptual lectures. I like to write code to understand a tool - so let&amp;#39;s do that and I&amp;#39;ll explain what I know along the way.&lt;/p&gt;

&lt;p&gt;Open up js/app.js and create the Ember application:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;HelloEmber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;We have an application, which is a lovely start. We need at least two more things before we know that Ember is even alive and running:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a View&lt;/li&gt;
&lt;li&gt;a Controller&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The simplest view to create is the overall application view - let&amp;#39;s add that to our HTML page, removing the first-level headers:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/x-handlebars&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;data-template-name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;application&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;This script tag is a Handlebars template. If you don&amp;#39;t know what that is: it&amp;#39;s just like an ERB template in Rails (or a Razor template in ASP.NET MVC) except it works with Javascript on the client.&lt;/p&gt;

&lt;p&gt;Handlebars is pretty simple to use, and Ember extends some of its functionality to make it work happily with the Ember bits.&lt;/p&gt;

&lt;p&gt;We&amp;#39;ve identified this template using &lt;code&gt;data-template-name&lt;/code&gt; as being the main application viewport. Let&amp;#39;s stick something in it.&lt;/p&gt;

&lt;h2&gt;Step 2: The Application Controller&lt;/h2&gt;

&lt;p&gt;If you&amp;#39;re familiar with Rails-style MVC, well... forget it. There are many flavors of MVC and we&amp;#39;ll be working with Desktop/Smalltalk-80 style here. This confused me greatly, and I still don&amp;#39;t know how I feel about it, but it doesn&amp;#39;t matter. This is the way Ember works.&lt;/p&gt;

&lt;p&gt;In short: &lt;strong&gt;Controllers in Ember convey data to your templates&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To see this let&amp;#39;s create our first Controller. Open up app.js:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;HelloEmber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;HelloEmber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ApplicationController&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Controller&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Good Morning Starshine!&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;happyThought&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;The Earth Says Hello!&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;If you&amp;#39;ve used Backbone before, this will look very odd. I should also mention that using the ApplicationController like this is not a good idea - I&amp;#39;ll fix it in just a second.&lt;/p&gt;

&lt;p&gt;Let&amp;#39;s update the view so we can see our data:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/x-handlebars&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;data-template-name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;application&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/h1&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h3&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;        &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;happyThought&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/h3&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;If you&amp;#39;re working in Chrome, make sure the console is open by using Cmd-Shift-I (or Ctrl-Shift-I in Windows). If you see any errors here, correct them. It&amp;#39;s likely you might have a 404 reference to one of your script files, or you&amp;#39;ve put them in your page in the wrong order (use my code above for the right order).&lt;/p&gt;

&lt;p&gt;If everything is working: refresh your page - you should see a nice, Wonka greeting.&lt;/p&gt;

&lt;h2&gt;Step 3: Conventions&lt;/h2&gt;

&lt;p&gt;Look back over what we&amp;#39;ve written. Nowhere did we state &amp;quot;get this template and render it this way&amp;quot;. Instead, Ember used the name of our template and married it up with the name of our Controller - and it all &lt;em&gt;just worked&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is a key bit of understanding with Ember: &lt;strong&gt;Naming things properly is everything&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To see this, let&amp;#39;s get out of working with our ApplicationController directly.&lt;/p&gt;

&lt;p&gt;First, create a new Controller, we&amp;#39;ll call it the &amp;quot;IndexController&amp;quot;. Don&amp;#39;t name it something else - IndexController is what shows by default:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;HelloEmber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;HelloEmber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;IndexController&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Controller&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Good Morning Starshine!&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;happyThought&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;The Earth Says Hello!&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Now, let&amp;#39;s update our view so that the application view doesn&amp;#39;t have hard-coded values in it:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/x-handlebars&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;data-template-name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;application&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;outlet&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/x-handlebars&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;data-template-name=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;index&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/h1&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h3&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;        &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;happyThought&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="err"&gt;/h3&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Refresh your page. You should see the same thing we saw before: a nice Wonka greeting. But what happened here?&lt;/p&gt;

&lt;p&gt;Again: naming conventions at work. The ApplicationController is gone from our code, but it still exists &amp;quot;behind the scenes&amp;quot; as Ember created it for us. In the first example (where we worked directly with it) - you can think of that as &amp;quot;overriding&amp;quot; the ApplicationController.&lt;/p&gt;

&lt;p&gt;The same goes with the IndexController. It was always there - but we didn&amp;#39;t need it. In the second example we essentially &amp;quot;overrode&amp;quot; the IndexController and created a view for it.&lt;/p&gt;

&lt;p&gt;The rendered view was then injected into the application view where &lt;code&gt;{{outlet}}&lt;/code&gt; sits on the page. You can think of &lt;code&gt;{{outlet}}&lt;/code&gt; in the same way that &lt;code&gt;yield&lt;/code&gt; is used in Rails.&lt;/p&gt;

&lt;h2&gt;Step 4: Models and Routing&lt;/h2&gt;

&lt;p&gt;We&amp;#39;ve done some basic stuff here, let&amp;#39;s explore the other parts of Ember. Once again, I&amp;#39;ll keep it &lt;strong&gt;extremely simple&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;In app.js, let&amp;#39;s define a model. I&amp;#39;ll do this by extending an Ember Object:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;HelloEmber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Greeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Good Morning Starshine!&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;happyThought&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;The Earth Says Hello!&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt; - this code has been changed based on feedback from Tom Dale and comments below.&lt;/p&gt;

&lt;p&gt;Now, let&amp;#39;s define a Route. Routes in Ember help to link models to Controllers:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;//our app&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;HelloEmber&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;//our model&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;HelloEmber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Greeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Good Morning Starshine!&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;happyThought&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;The Earth Says Hello!&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;//our route&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;HelloEmber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;IndexRoute&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;HelloEmber&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Greeting&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;This is all the code you should have in app.js. Notice how we have no Controller? We don&amp;#39;t need one. This is confusing, but let&amp;#39;s make sure things are working - refresh your page and you should see everything working just fine.&lt;/p&gt;

&lt;p&gt;Assuming that it is - what we have here is naming magic at work, again. We&amp;#39;ve always had an IndexRoute (Ember created it for us since we didn&amp;#39;t explicitly declare one) - but this time we wanted to specify a model so we needed to use a Route.&lt;/p&gt;

&lt;p&gt;I mentioned that the Route exists to marry up a Controller to a Model, &lt;strong&gt;but we have no Controller!&lt;/strong&gt; This can be maddening: we &lt;em&gt;do have a Controller&lt;/em&gt;, we just didn&amp;#39;t have to write the code for it: Ember did that for us.&lt;/p&gt;

&lt;p&gt;The Controller that Ember created (the IndexController) was associated to our Route because we kept with the Ember naming magic. That Controller took the model that was available on the Route and &amp;quot;grafted it&amp;quot; onto itself, making the data on the model available to our view.&lt;/p&gt;

&lt;h2&gt;Good Job!&lt;/h2&gt;

&lt;p&gt;If you&amp;#39;ve made it this far, you now know as much as I do. There&amp;#39;s a lot happening in the background with Ember; the goal being that the Ember team wants to reduce the tedious &amp;quot;boilerplate&amp;quot; code you write with other frameworks, like Backbone.&lt;/p&gt;

&lt;p&gt;This can be a neat thing, it can also be highly confusing if you don&amp;#39;t know what&amp;#39;s going on.&lt;/p&gt;

&lt;p&gt;I encourage you to play around with Ember and Handlebars now that you have your footing. It&amp;#39;s an interesting thought experiment that works well for many developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;I&amp;#39;m not an Ember expert by any stretch so if you&amp;#39;ve found any misstatements or silliness here, please do let me know and I&amp;#39;ll adjust.&lt;/em&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yMrhlO3kWpI:JEq8vZS8rjk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yMrhlO3kWpI:JEq8vZS8rjk:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=yMrhlO3kWpI:JEq8vZS8rjk:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yMrhlO3kWpI:JEq8vZS8rjk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=yMrhlO3kWpI:JEq8vZS8rjk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yMrhlO3kWpI:JEq8vZS8rjk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=yMrhlO3kWpI:JEq8vZS8rjk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/yMrhlO3kWpI" height="1" width="1"/&gt;</content>
    <published>2013-03-20T10:00:00-05:00</published>
    <updated>2013-03-20T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/03/20/ember-baby-steps</feedburner:origLink></entry>
  <entry>
    <title>Convention Over Incantation?</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/yy_zah6tFWw/convention-over-incantation" />
    <id>tag:wekeroad.com,2013-03-18:/2013/03/18/convention-over-incantation</id>
    <content type="html">&lt;p&gt;Convention over Configuration is now simply an assumed thing for modern frameworks - and this is (mostly) a good thing. Sometimes I wonder if it's being taken too far.&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/incantations.jpg'/&gt;&lt;/p&gt;&lt;p&gt;&lt;h2&gt;Conventions? Curations? Innovations?&lt;/h2&gt;

&lt;p&gt;Convention over Configuration is a &amp;quot;pull&amp;quot; - meaning that it&amp;#39;s derived from practice. Conventions evolve and ultimately people agree on them… thus the term &amp;quot;convention&amp;quot;.&lt;/p&gt;

&lt;p&gt;Rails made use of this most profoundly when it was introduced. From &lt;a href="http://gilesbowkett.blogspot.com/2013/02/the-lie-of-convention-over-configuration.html"&gt;Giles Bowkett&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When Rails first arrived, in many instances, it took the greatest ideas and most common use cases of Web development, streamlined them, simplified their developer interface, and repackaged them within cleaner APIs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Rails also decided to innovate at the same time, and mixed together its conventions with its innovations. The results have been mixed (in my experience):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Asset Pipeline was an interesting solution to a problem that I&amp;#39;m not sure many people had. I spent more time trying to get the thing to work as expected - and then finally tossed it.&lt;/li&gt;
&lt;li&gt;I used CoffeeScript for a bit, but don&amp;#39;t care much for it. This decreases the interest in the Asset Pipeline.&lt;/li&gt;
&lt;li&gt;I like RSpec. I like Factories vs. Fixtures. &lt;a href="http://www.youtube.com/watch?v=obOd7WrrTWQ"&gt;I tend to completely replace the entire testing experience Rails&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren&amp;#39;t complaints, really. Every framework you use needs to be modified to a degree to fit how you work - but I do agree with Giles&amp;#39; assertion:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;it is literally impossible to impose a convention on a community. It is a contradiction in terms, Orwellian doublespeak, and the human-language equivalent of a syntax error.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For all of the syntax niggling, Rails still lets me do what I want/need to do so I&amp;#39;m a happy camper. I also think the &amp;quot;conventions&amp;quot; it once imposed are being tweaked by innovation and becoming something else.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://gilesbowkett.blogspot.com/2013/02/the-lie-of-convention-over-configuration.html"&gt;Giles calls it &amp;quot;Curation over Configuration&amp;quot;&lt;/a&gt; and I think I agree with him.&lt;/p&gt;

&lt;h2&gt;Put Your Left Foot Here, Touch Your Nose, And…&lt;/h2&gt;

&lt;p&gt;It seems that most frameworks (of any kind) are beginning to follow Rails&amp;#39; example by introducing some level of Convention over Configuration. This is a great timesaver, &lt;strong&gt;unless there are no conventions to adopt&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Which is something I&amp;#39;ve encountered with EmberJS. No, I&amp;#39;m not going to rant on Ember - I&amp;#39;m still pursuing Trek&amp;#39;s prediction:&lt;/p&gt;

&lt;p&gt;&lt;blockquote class="twitter-tweet"&gt;&lt;p&gt;@&lt;a href="https://twitter.com/locks"&gt;locks&lt;/a&gt; next post will be about @&lt;a href="https://twitter.com/robconery"&gt;robconery&lt;/a&gt;&amp;#39;s Road to Damascus Moment. ;)&lt;/p&gt;&amp;mdash; Trek Glowacki (@trek) &lt;a href="https://twitter.com/trek/status/310882156425650177"&gt;March 10, 2013&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="//platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;I haven&amp;#39;t given up on Ember - even though I said as much in my last post. Well it&amp;#39;s partly &lt;strong&gt;because of my last post&lt;/strong&gt; that I can&amp;#39;t give up - it wouldn&amp;#39;t be fair of me would it :).&lt;/p&gt;

&lt;p&gt;As I dive into Ember more, however, &lt;a href="http://emberjs.com/guides/concepts/naming-conventions/"&gt;I&amp;#39;ve begun musing on &amp;quot;conventions&amp;quot; in general&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ember.js uses naming conventions to wire up your objects without a lot of boilerplate. You will want to use the conventional names for your routes, controllers and templates.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By &amp;quot;convention&amp;quot; the team means &amp;quot;prescription&amp;quot;. This is important because &lt;strong&gt;there is no convention&lt;/strong&gt; when it comes to Single Page Applications in the traditional sense of the word &amp;quot;convention&amp;quot;. &lt;strong&gt;Their naming guidelines are prescriptive&lt;/strong&gt; - and something more.&lt;/p&gt;

&lt;p&gt;A lot of frameworks do this kind of thing: Rails, Django, ASP.NET MVC (and I&amp;#39;m sure many others) expect certain files (views, for instance) to be in a particular place (which you can usually override). I like this - it promotes consistency. &lt;/p&gt;

&lt;p&gt;Ember takes this to a different level, however. If you name things a certain way &lt;a href="http://net.tutsplus.com/tutorials/javascript-ajax/getting-into-ember-js/"&gt;you can benefit from background code generation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One of the ways that Ember.js helps to minimize the amount of code needed and handle things for you behind the scenes is through naming conventions. The way that you define and name your routes (and resources) impacts the naming of your controllers, models, views and templates&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;At what point do we call these &amp;quot;Incantations&amp;quot; instead of &amp;quot;Conventions&amp;quot;&lt;/strong&gt;? &lt;/p&gt;

&lt;h2&gt;The Light Isn&amp;#39;t Blinding Me Yet&lt;/h2&gt;

&lt;p&gt;Again - not here to pick on Ember. Strong naming has been around for a while (though I&amp;#39;m not sure I&amp;#39;ve seen it trigger code generation) and, far from condemning Ember - I applaud the team for taking a bold step.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ll admit that it&amp;#39;s not immediately sitting right with me, but I&amp;#39;m going to give it time to see how hard it will be for the incantations to work their way into daily memory. I&amp;#39;ll &lt;a href="http://en.wikipedia.org/wiki/Conversion_of_Paul_the_Apostle"&gt;keep travelling the road&lt;/a&gt;... until I&amp;#39;m blinded by the light or... get delirious from the heat.&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yy_zah6tFWw:Ej_rT7Ik9B0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yy_zah6tFWw:Ej_rT7Ik9B0:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=yy_zah6tFWw:Ej_rT7Ik9B0:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yy_zah6tFWw:Ej_rT7Ik9B0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=yy_zah6tFWw:Ej_rT7Ik9B0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=yy_zah6tFWw:Ej_rT7Ik9B0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=yy_zah6tFWw:Ej_rT7Ik9B0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/yy_zah6tFWw" height="1" width="1"/&gt;</content>
    <published>2013-03-18T10:00:00-05:00</published>
    <updated>2013-03-18T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/03/18/convention-over-incantation</feedburner:origLink></entry>
  <entry>
    <title>EmberJS Confuses Me</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/fCXbpkBXK6M/ember-confuses-me" />
    <id>tag:wekeroad.com,2013-03-06:/2013/03/06/ember-confuses-me</id>
    <content type="html">&lt;p&gt;I've been teeth-deep in Client-side Javascript frameworks over the last 4 months for Tekpub. This month is Angular, last month was Ember's turn and I gave up. It's the first time I've given up - here's why.&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/spinning-dizzy.jpeg'/&gt;&lt;/p&gt;&lt;p&gt;&lt;h2&gt;I Tried&lt;/h2&gt;

&lt;p&gt;Saying something confuses me is no great claim - many things do. It&amp;#39;s entirely likely that I didn&amp;#39;t study Ember long enough, or maybe I didn&amp;#39;t give it the &amp;quot;time to soak in&amp;quot; that it deserved. Either way I punted on my efforts to bring an Ember title to Tekpub.&lt;/p&gt;

&lt;p&gt;Normally I&amp;#39;d just go about my business and sidestep posts like this one - but today I had a conversation with Trek Glowacki (core dev on the Ember team) and he was confused as to my confusion. I offered to blog my thoughts - he couldn&amp;#39;t understand the points I was making about my confusion. &lt;/p&gt;

&lt;p&gt;So here&amp;#39;s that post, stripped of hyperbole and &amp;quot;it&amp;#39;s ON FIRE&amp;quot; statements. It&amp;#39;s my honest take on this framework.&lt;/p&gt;

&lt;h2&gt;You Keep Telling Me It&amp;#39;s MVC...&lt;/h2&gt;

&lt;p&gt;Yes, the concept of MVC has been contorted over the past decade as web frameworks have adopted it and massaged it to their own ends. What does this mean?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Controllers in web MVC have a very short lifespan, and there are a lot of them typically&lt;/li&gt;
&lt;li&gt;Views dont&amp;#39; communicate directly to a controller - they have to use an intermediary layer in HTTP (headers, querystring, etc)&lt;/li&gt;
&lt;li&gt;Models are injected into views by Controllers&lt;/li&gt;
&lt;li&gt;Controllers don&amp;#39;t command the views directly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In more classic MVC (aka &amp;quot;Desktop&amp;quot;) your controllers are typically spun up when the app starts, and configured one time, right there. A controller&amp;#39;s job is to command aspects of the view as data changes, and to change the model when things on the view happen that mandate it. &lt;/p&gt;

&lt;p&gt;The model encapsulates the business logic for whatever its modeling, the view presents the data in a nicely formatted way to the user, and the controller sits between. I think we agree on this much - so what&amp;#39;s the problem?&lt;/p&gt;

&lt;p&gt;OK this is MVC as far as I have come to know it. There are lots of denominations I am sure - I have to think the church of MVC is about as crowded as the church of REST on any given holiday but there&amp;#39;s room for all of us so let&amp;#39;s move on...&lt;/p&gt;

&lt;h2&gt;Separation. Only Not.&lt;/h2&gt;

&lt;p&gt;In EmberJS, the &lt;a href="http://emberjs.com/guides/controllers/"&gt;controller&amp;#39;s job is changed a bit&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A controller may have one or both of these responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Representing a model for a template.&lt;/li&gt;
&lt;li&gt;Storing application properties that do not need to be saved to the server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most of your controllers will be very small. Unlike other frameworks, where the state of your application is spread amongst many controllers, in Ember.js, we encapsulate that state in the router. This allows your controllers to be lightweight and focused on one thing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For me, this is where the confusion begins. A controller proxies the model, and then exposes itself to the rendering engine so that the view can consume it (you may need to read that sentence twice). As a result, we have view code like this (this is Handlebars):&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;{{#each person in personController}}
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{{name}}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;{{/each}}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;This can be shorthanded to this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;{{#each controller}}
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{{name}}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;{{/each}}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;This is where I hit a conceptual wall&lt;/strong&gt;. First: let me say that I&amp;#39;m not the best programmer in the world and I could be dead wrong on this. But as far as I understand it, this is about as tightly bound as we can make things.&lt;/p&gt;

&lt;p&gt;As stated above, a controller &amp;quot;proxies&amp;quot; the model onto itself for use in the view. I&amp;#39;m trying my best to reconcile this with the notion that a controller (classically speaking) is supposed to ... well &lt;strong&gt;control&lt;/strong&gt; the view. Here, it&amp;#39;s not doing that. &lt;/p&gt;

&lt;p&gt;If I&amp;#39;m not mistaken, the view is controlling the controller and the model is nowhere to be found. Well that&amp;#39;s not true I spose: &lt;strong&gt;the model is the controller&lt;/strong&gt;. Sort of. Well it&amp;#39;s not literally the same thing in concept but in practice the controller and the model are one. Bound. Together. Tightly.&lt;/p&gt;

&lt;p&gt;In Angular this separation is achieved by a &amp;quot;scope&amp;quot; object that is, basically, a vehicle of sorts that gets passed between the controller and the view:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;PersonCtrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt; &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;people&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Rob&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Mary&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;In your view, you declare which controller you&amp;#39;re using and then consume the information that&amp;#39;s on the scope:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;ng-app&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;ng-controller=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;PersonCtrl&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;ng-repeat=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;person in people&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{name}}&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;The downside to this approach is that your HTML is &amp;quot;compromised&amp;quot;, if you will, and many developers don&amp;#39;t like that. My thought is that &lt;strong&gt;it&amp;#39;s already compromised using Handlebars&lt;/strong&gt; so what&amp;#39;s the difference here?  Personally I have no issue using the ng-* directives. Some people do, and I respect that.&lt;/p&gt;

&lt;p&gt;But let&amp;#39;s get to the controller code. Notice that the $scope is injected? That&amp;#39;s Dependency Injection at work and is a core concept in Angular which greatly helps testability.&lt;/p&gt;

&lt;p&gt;Now you might be saying &amp;quot;but ROB! The controller is declared directly in the view! That&amp;#39;s the same problem!&amp;quot;. And that&amp;#39;s true - until you loop in routing (below) and you can remove that directive since it&amp;#39;s handled explicitly by routing:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='html'&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;ng-app&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;ng-repeat=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;person in people&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{person.name}}&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;In Backbone a view is created (optionally) with the model (or collection) that it needs for data. There are no controllers (classically) in Backbone - though you can surely wedge one if needed and have it deal with the view.&lt;/p&gt;

&lt;p&gt;These concepts align with my understanding of MVC. Not the case with Ember - if anything it confuses me greatly.&lt;/p&gt;

&lt;h2&gt;Routes, Objects, and More Confusion&lt;/h2&gt;

&lt;p&gt;I can get past the controller issue - I&amp;#39;m not a purist and if there&amp;#39;s a reason the team wanted it this way, then I believe them. &lt;a href="http://yehudakatz.com/"&gt;It&amp;#39;s Yehuda&lt;/a&gt; and I think Yehuda is a very nice and smart person (as is &lt;a href="http://tomdale.net/"&gt;Tom Dale&lt;/a&gt; - the co-creator of Ember). &lt;/p&gt;

&lt;p&gt;I respect these guys so much I want to be very careful to &lt;strong&gt;not suggest&lt;/strong&gt; that they don&amp;#39;t know what they&amp;#39;re doing. As I keep saying: &lt;strong&gt;this is my confusion&lt;/strong&gt;. I own it.&lt;/p&gt;

&lt;p&gt;Which brings me to Routes. Here&amp;#39;s &lt;a href="http://emberjs.com/guides/routing/defining-your-routes/"&gt;one way to define a route&lt;/a&gt; using EmberJS that looks rather familiar:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;posts&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/posts&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;new&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Rails devs will recognize this straight away as a Resourceful Route. But what does a &amp;quot;resource&amp;quot; have to do with a Desktop app? When talking routes, urls, and resources - that&amp;#39;s a RESTful consideration and involves stateless state &amp;quot;stuff&amp;quot; (sidestepping the REST debate here). &lt;strong&gt;What is this concept doing in a desktop app?&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here&amp;#39;s another way to define a route:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;about&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;favorites&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;/favs&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;This is straightforward. Client MVC apps can manipulate browser history with &amp;quot;hashbang&amp;quot; URLs for bookmarking convenience. To manage that, we use a router and define routes.&lt;/p&gt;

&lt;p&gt;And if you know that Ember relies heavily on naming conventions you could probably assume that you&amp;#39;ll need an AboutController and a FavoritesController (like Rails - and Yehuda is a Rails core dev too so it would make sense...).&lt;/p&gt;

&lt;p&gt;But that&amp;#39;s not quite what needs to happen. You need to also define a RouteObject (which you can think of as a route handler):&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FavoritesRoute&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Favorites&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;setupController&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;content&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;I&amp;#39;ve been repeatedly told that &amp;quot;Ember uses MVC in the classical Desktop way&amp;quot; following Cocoa/Smalltalk style. OK I can buy that - but if that&amp;#39;s the case &lt;strong&gt;why are controllers being tied to routes and models&lt;/strong&gt;, conceptually? That might make sense for the web, but hardly for a desktop app.&lt;/p&gt;

&lt;p&gt;Now I completely understand that we can throw theory at this &lt;a href="http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html"&gt;and that Smalltalk-80 MVC&lt;/a&gt; was instrumental in forming the concept behind Ember. &lt;/p&gt;

&lt;p&gt;But even then - one model could be used in many controllers (and the reverse) depending on the need. I&amp;#39;m happy to shift my mind into Desktop mode - but it seems Ember still wants to retain some conceptual likeness to Rails, which I find most ... strange.&lt;/p&gt;

&lt;p&gt;I remember watching &lt;a href="http://blog.peepcode.com"&gt;Geoffrey Grosenbach&lt;/a&gt; explaining this in &lt;a href="https://peepcode.com/products/emberjs"&gt;Peepcode&amp;#39;s very well done video tutorial on EmberJS&lt;/a&gt; and feeling rather confused. I rewound the section and played it back, to see if I could understand what I was seeing.&lt;/p&gt;

&lt;p&gt;And rewound it a few more times after that. It wasn&amp;#39;t sinking in. I could not understand the difference between declaring a route, and configuring a RouteObject. Why not have the URL be a setting on the Ember.Route?&lt;/p&gt;

&lt;p&gt;Now it could be that it was this way in the past - I&amp;#39;ve only gotten to know Ember 1.0 rc1 and I also know that the API changes rather dramatically from time to time.&lt;/p&gt;

&lt;p&gt;But this is really confusing.&lt;/p&gt;

&lt;p&gt;Here&amp;#39;s how you do it in Angular:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;span class='line-number'&gt;14&lt;/span&gt;
&lt;span class='line-number'&gt;15&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;//declare the app and any dependencies&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;angular&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;App&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,[]);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="c1"&gt;//configure the app, injecting the Route Provider&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$routeProvider&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;$routeProvider&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;when&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/about&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;templateUrl&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;about.html&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;controller&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;App.AboutCtrl&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;when&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/favorites&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;controller&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;App.FavoritesCtrl&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;      &lt;span class="nx"&gt;templateUrl&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;favorites.html&amp;quot;&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;Angular&amp;#39;s approach is interesting and somewhat &amp;quot;concept-y&amp;quot; if you&amp;#39;re not familiar with Dependency Injection. Once you get past that (or maybe you love it already) it becomes straightforward to understand that &amp;quot;here&amp;#39;s a route, use this template and this controller&amp;quot;. This is straight up configuration: &lt;strong&gt;which is exactly what the method name is&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I love parity between method names and the code I&amp;#39;m writing.&lt;/p&gt;

&lt;p&gt;Here&amp;#39;s how you do it in Backbone:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Backbone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="s2"&gt;&amp;quot;/about&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;showAbout&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="s2"&gt;&amp;quot;/favorites&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;showFavorites&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;showAbout&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="c1"&gt;//render the view, or call to a controller&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;showFavorites&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="c1"&gt;//render the view, or call to a controller&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;The Router in Backbone is also a bit confusing - there&amp;#39;s no doubt about it. It can quickly turn into a mess of configuration AND instrumentation - in other words doing a controller&amp;#39;s job.&lt;/p&gt;

&lt;p&gt;I think this is why the Ember team tried to separate the configuration of the routes from the route itself. But in doing so they marginalized the controller (which was their intent, if you read the controller&amp;#39;s definition).&lt;/p&gt;

&lt;p&gt;With Backbone I know what I&amp;#39;m getting into. I can use the Router as a controller (it used to be called that btw) and when things get a bit nuts, I can create a controller of my very own (&lt;a href="http://marionettejs.com"&gt;or just use MarionetteJS that has this concept built in&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;Naming&lt;/h2&gt;

&lt;p&gt;Ember relies heavily on naming conventions that must not only follow &lt;a href="http://www.emberist.com/2012/04/09/naming-conventions.html"&gt;syntax guidelines, but also casing guidelines&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The reason for this is straightforward: Ember will generate code for you if you just need basic, boilerplated stuff, alleviating you from tedious coding which is rampant in other frameworks like Backbone.&lt;/p&gt;

&lt;p&gt;The problem I have with this is that the relationship between things is in name only, and that seems like it&amp;#39;s a rather brittle rule. It also tells me that I have to know the naming conventions &lt;strong&gt;as well as&lt;/strong&gt; how to use the framework - which is fine, typically, as long as there&amp;#39;s a big payoff.&lt;/p&gt;

&lt;p&gt;And that&amp;#39;s where I get stuck (again): &lt;strong&gt;what&amp;#39;s the payoff, aside from implicit code generation, for following the naming conventions here?&lt;/strong&gt;. Consider the routing code, above:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;span class='line-number'&gt;10&lt;/span&gt;
&lt;span class='line-number'&gt;11&lt;/span&gt;
&lt;span class='line-number'&gt;12&lt;/span&gt;
&lt;span class='line-number'&gt;13&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;about&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;/about&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;favorites&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;/favs&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FavoritesRoute&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Favorites&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;setupController&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;content&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;The only way I know that one thing depends on the other is by name. Now I know that should seem obvious and you might be thinking &amp;quot;well duh, Rob, that&amp;#39;s the point!&amp;quot;. Yes, but it&amp;#39;s also a great way to have a highly confusing API.&lt;/p&gt;

&lt;p&gt;What&amp;#39;s the problem with something like this:&lt;/p&gt;

&lt;figure class='code'&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;/figcaption&gt;&lt;div class="highlight"&gt;&lt;table&gt;&lt;tr&gt;&lt;td class="gutter"&gt;&lt;pre class="line-numbers"&gt;&lt;span class='line-number'&gt;1&lt;/span&gt;
&lt;span class='line-number'&gt;2&lt;/span&gt;
&lt;span class='line-number'&gt;3&lt;/span&gt;
&lt;span class='line-number'&gt;4&lt;/span&gt;
&lt;span class='line-number'&gt;5&lt;/span&gt;
&lt;span class='line-number'&gt;6&lt;/span&gt;
&lt;span class='line-number'&gt;7&lt;/span&gt;
&lt;span class='line-number'&gt;8&lt;/span&gt;
&lt;span class='line-number'&gt;9&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class='code'&gt;&lt;pre&gt;&lt;code class='javascript'&gt;&lt;span class='line'&gt;&lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FavoritesRoute&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Ember&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;about&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;/about&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Favorites&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="nx"&gt;setupController&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;    &lt;span class="nx"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;content&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;span class='line'&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;

&lt;p&gt;This, to me, is a whole lot more apparent and I&amp;#39;m not reconciling functionality through a naming filter. For some that might be much easier than reading the code (or reading the tests) - to me it seems arbitrary and confusing.&lt;/p&gt;

&lt;h2&gt;You Asked, I Answered&lt;/h2&gt;

&lt;p&gt;In wrapping this up, I would like to say that I am writing this as a way to make my points a bit clearer to Trek as Twitter doesn&amp;#39;t work well for this kind of thing. He didn&amp;#39;t understand my confusion about Ember (specifically why I didn&amp;#39;t think it aligned with my understanding of MVC) so I told him I&amp;#39;d write something that explained my confusion.&lt;/p&gt;

&lt;p&gt;It would be easy to see this as &amp;quot;Rob ranting on Ember&amp;quot; and I&amp;#39;m sure it will be taken that way by many. Not my intent, really. I have 4 videos to edit in front of me, and a book to write. I took time out of my day to respectfully respond to the Ember team with my thoughts - even if they&amp;#39;re not glowing and exciting with praise.&lt;/p&gt;

&lt;p&gt;If Ember works for you I think that&amp;#39;s great. It doesn&amp;#39;t work for me.&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=fCXbpkBXK6M:hHMSfTcE-sk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=fCXbpkBXK6M:hHMSfTcE-sk:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=fCXbpkBXK6M:hHMSfTcE-sk:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=fCXbpkBXK6M:hHMSfTcE-sk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=fCXbpkBXK6M:hHMSfTcE-sk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=fCXbpkBXK6M:hHMSfTcE-sk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=fCXbpkBXK6M:hHMSfTcE-sk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/fCXbpkBXK6M" height="1" width="1"/&gt;</content>
    <published>2013-03-06T10:00:00-05:00</published>
    <updated>2013-03-06T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/03/06/ember-confuses-me</feedburner:origLink></entry>
  <entry>
    <title>Pair Coding With KnockoutJS</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/mkcrjatygrY/pair-coding-with-knockoutjs" />
    <id>tag:wekeroad.com,2013-02-21:/2013/02/21/pair-coding-with-knockoutjs</id>
    <content type="html">&lt;p&gt;I was lucky enough to get some help from Ryan Niemeyer (KnockoutJS core contributor) recently, and, like I do, I asked if I could record it. I love stuff like this: I need this to work well for the Real World, and I want to do it right.&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/knockout_refactor_slide.png'/&gt;&lt;/p&gt;&lt;p&gt;&lt;h2&gt;An Expert at Work&lt;/h2&gt;

&lt;p&gt;Most of us can figure out what we&amp;#39;re trying to do with a new toolset - it&amp;#39;s all about reading the docs and playing around until the philosophy of the thing creeps its way in and the tool begins to fit our hand just a bit better.&lt;/p&gt;

&lt;p&gt;Every now and again, though, you&amp;#39;re reminded just how much you don&amp;#39;t know. That was the case when I asked 
&lt;a href="http://www.knockmeout.net/"&gt;Ryan Niemeyer&lt;/a&gt; to take a look at the &lt;a href="http://github.com/tekpub/knockout-cart"&gt;Knockout Cart&lt;/a&gt; that I open sourced from Tekpub&amp;#39;s codebase. I was proud of that thing but I also knew it needed a little help.&lt;/p&gt;

&lt;p&gt;As with so many things - I was in a hurry, it worked, I felt like it was a decent initial release, etc. Anyway, Ryan joined me and from that we have our latest video on Tekpub:&lt;/p&gt;

&lt;iframe src="http://player.vimeo.com/video/60131454" width="650" height="362" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt;

&lt;p&gt;This one is wall-to-wall coding, and Ryan doesn&amp;#39;t miss a trick. Great stuff, and I was happy to be a part of it! &lt;a href="http://tekpub.com/products/knockout_refactor"&gt;You can watch the whole thing up at Tekpub&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=mkcrjatygrY:IzeUTyGpoS8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=mkcrjatygrY:IzeUTyGpoS8:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=mkcrjatygrY:IzeUTyGpoS8:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=mkcrjatygrY:IzeUTyGpoS8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=mkcrjatygrY:IzeUTyGpoS8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=mkcrjatygrY:IzeUTyGpoS8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=mkcrjatygrY:IzeUTyGpoS8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/mkcrjatygrY" height="1" width="1"/&gt;</content>
    <published>2013-02-21T10:00:00-05:00</published>
    <updated>2013-02-21T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/02/21/pair-coding-with-knockoutjs</feedburner:origLink></entry>
  <entry>
    <title>Customer Service vs. Serving the Customer</title>
    <author>
      <name>Rob Conery</name>
      <uri>http://wekeroad.com</uri>
    </author>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/wekeroad/EeKc/~3/PZzbWDi8bww/customer-service-vs-serving-the-customer" />
    <id>tag:wekeroad.com,2013-02-18:/2013/02/18/customer-service-vs-serving-the-customer</id>
    <content type="html">&lt;p&gt;If you've ever sent a support email to Tekpub, you know I'm in the habit of asking questions. I think truly serving the Customer sometimes means asking questions, and sometimes even saying "No"...&lt;/p&gt;&lt;p&gt;&lt;img src='http://wekeroad.com/images/service.jpeg'/&gt;&lt;/p&gt;&lt;p&gt;&lt;h2&gt;May I Help You?&lt;/h2&gt;

&lt;p&gt;I receive a number of support emails during the normal work week. They are mostly technical ones about our streaming player or questions about our content. Occasionally requests for certain topics.&lt;/p&gt;

&lt;p&gt;And then there are the requests for refunds. This happens rather rarely, but when they do I tend to take extra time with them. This tends to piss people off and typically I have to wade through a lot of back and forth before we get down to the problem.&lt;/p&gt;

&lt;p&gt;The following really happened, and (as you might expect) I&amp;#39;m paraphrasing a bit - not revealing names:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Customer&lt;/strong&gt;: &amp;quot;I don&amp;#39;t find your service worth it and would like my money back.&amp;quot;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Me&lt;/strong&gt;: &amp;quot;Sorry to hear that! What&amp;#39;s the problem&amp;quot;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customer&lt;/strong&gt;: &amp;quot;As I said I don&amp;#39;t find value in your videos - can I have a refund or not? Is this going to be one of those things that I have to fill out some questionnaire or stupid survey. DUDE JUST CANCEL MY SUB&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So at this point I have a problem. Do I continue asking him about the problem or do I just refund him and remember that &amp;quot;The Customer is Always Right&amp;quot;. What would you do?&lt;/p&gt;

&lt;p&gt;One thing I know is that an unhappy customer, tended to correctly, will rapidly turn into one of your happiest customers. It&amp;#39;s a gamble, especially when CAPS are invoked... but I pressed on.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Me&lt;/strong&gt;: Listen I understand you&amp;#39;re not happy but sometimes it comes down to knowing just a bit more about a problem and I can fix it - and often it makes people very happy. If you had the time to explain just a bit - I would really appreciate it. Your refund is on the way, by the way.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is one of my standard responses. Typically (not always) I will send the refund immediately. Upset people tend to become less upset, and then answer your questions. In this case, it worked out really well:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Customer&lt;/strong&gt;: Sorry I should be a bit more clear. I &lt;strong&gt;love your videos&lt;/strong&gt; and they&amp;#39;re really good, but I can&amp;#39;t afford the service and I thought I could but I just lost my job and I need to pull things back in. I didn&amp;#39;t mean to be insulting and I guess I&amp;#39;m a bit stressed out. Thanks for the refund and if I get another job soon I&amp;#39;ll come back.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Me&lt;/strong&gt;: No problem at all and thanks for letting me know this - it really does make a difference. XXXXXXXXX - that&amp;#39;s a coupon for an Annual Subscription. Educating yourself will help find work and, if you want to pay me back, &lt;a href="http://tekpub.com/gifts/new"&gt;buy an annual for someone else&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Needless to say, the Customer was ecstatic and we solved the problem - something I would never have known about unless I pushed a little bit - &lt;strong&gt;pushed the Customer to let me help them&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I give stuff away constantly - especially to people who need it.&lt;/p&gt;

&lt;h2&gt;This Backfires&lt;/h2&gt;

&lt;p&gt;Just today - in fact it&amp;#39;s the reason I&amp;#39;m writing this post - someone asked me for a refund. It was the first in 4 months and, as I do, I asked some questions first.&lt;/p&gt;

&lt;p&gt;Many businesses adopt a &amp;quot;No Questions Asked&amp;quot; policy and I understand why - it&amp;#39;s a blind guarantee and gives the appearance of standing squarely behind your product or service.&lt;/p&gt;

&lt;p&gt;I find that this is short-sited but NOT because you shouldn&amp;#39;t blindly guarantee your stuff, but &lt;strong&gt;it&amp;#39;s more likely there&amp;#39;s simply a misunderstanding happening, and you can FIX IT&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So anyway the Customer wanted a refund:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Customer&lt;/strong&gt;: I want a refund for my monthly subscription because Pluralsight has more content than you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Me&lt;/strong&gt;: They sure do, but I can&amp;#39;t guarantee our stuff against another company&amp;#39;s. I do know you&amp;#39;ll be happy with what we offer because it&amp;#39;s quite good and I notice you&amp;#39;ve only watched half of a single episode of all of our stuff. Might I recommend you give it some more time?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customer&lt;/strong&gt;: I didn&amp;#39;t ask you to guarantee Pluralsight - but you should do something to compare your stuff vs. theirs so people know the difference. Your refund policy states &amp;quot;... &amp;#39;snip&amp;#39; ...&amp;quot; Thus I&amp;#39;d like a refund.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here I have a problem. They haven&amp;#39;t watched any of our stuff and are, essentially, having &amp;quot;Buyer&amp;#39;s Remorse&amp;quot; as they saw more stuff at Pluralsight. &lt;a href="http://pluralsight.com/training/Courses"&gt;And Pluralsight has a whole lot of stuff&lt;/a&gt;. Buyer&amp;#39;s remorse and Pluralsight&amp;#39;s catalog are not covered under our refund policy (as you can imagine) so...&lt;/p&gt;

&lt;p&gt;If I keep pushing this angle, I&amp;#39;ll lose. Pluralsight has an amazing library but there are differences in our content - I need to get that across as well as the main point: &lt;strong&gt;Why not have both!&lt;/strong&gt;. It&amp;#39;s $15 + $29 == $45/month. Think of what that means in terms of educating yourself and readying your career! Yet people scrutinize this expense as if it were some kind of luxury!&lt;/p&gt;

&lt;p&gt;OK, so back to the matter at hand. How would you respond here? This is what I said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Me:&lt;/strong&gt; Our return policy covers what &lt;strong&gt;we create&lt;/strong&gt; and if you don&amp;#39;t like it, then yes we&amp;#39;ll stand behind that. But you haven&amp;#39;t tried it out yet and, forgive me if I&amp;#39;m misunderstanding here, you&amp;#39;re asking for a refund because Pluralsight has more stuff.&lt;/p&gt;

&lt;p&gt;I don&amp;#39;t want unhappy customers and I&amp;#39;m sending your refund now - but when you get to Pluralsight you might not want to look at Lynda.com.&lt;/p&gt;

&lt;p&gt;If you use Peepcode don&amp;#39;t try CodeSchool or Treehouse. What you see as an advantage (more videos) is hardly a measure of the content (and its relevance to you). Either way, your refund is on its way&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I should have left that last part out. That was my ego, feeling bruised and frustration setting in because I felt that what they were asking for was not entirely fair.&lt;/p&gt;

&lt;p&gt;And, as expected, the customer didn&amp;#39;t like my response. &lt;strong&gt;Things started getting personal and I was told my Customer Service sucks&lt;/strong&gt; (which wouldn&amp;#39;t be the first time). The Customer ended things by saying &amp;quot;I was planning on coming back to Tekpub if I didn&amp;#39;t like Pluralsight but... not with this Customer Service experience&amp;quot;.&lt;/p&gt;

&lt;p&gt;Which means I lose. Actually, we both lost because &lt;a href="http://support.pluralsight.com/knowledgebase/articles/32815-what-is-your-refund-policy-"&gt;I don&amp;#39;t think he&amp;#39;ll have the same option at Pluralsight&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Turning It Around. Or Turning It Off?&lt;/h2&gt;

&lt;p&gt;I lost that battle because I tried to reason with someone who was unhappy - and that is almost always a bad idea. There are ways of asking questions that don&amp;#39;t lead the Customer to believe they&amp;#39;re being screwed or messed with - and I was trapped with this one.&lt;/p&gt;

&lt;p&gt;They gave me money, and they regretted it even though they didn&amp;#39;t even try what they paid for. To me, &lt;strong&gt;I was utterly convinced that if they tried our stuff, they&amp;#39;d love it&lt;/strong&gt; and I kept trying to communicate that... but in the wrong way. I think I understand why many companies simply refuse to do refunds - it forces customers to consider a bit more carefully.&lt;/p&gt;

&lt;p&gt;This is not to say that you shouldn&amp;#39;t show Customers the door. I&amp;#39;ve had people (literally) try to extort me by &amp;quot;taking it to Hacker News&amp;quot; unless I refunded them for videos that my logs showed they were clearly sharing (multiple downloads to same IP over the period of a month). I asked them if it&amp;#39;s OK to loop in their legal department, then I deleted their account and banned them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are some customers you need to cut loose - basically a No Soup For You&lt;/strong&gt; policy. They exist, it sucks, and it spoils it for customers who aren&amp;#39;t Out To Get Your (to-date that&amp;#39;s happened 5 times and I&amp;#39;m not happy about it... but it needed to happen).&lt;/p&gt;

&lt;p&gt;On the bright side, &lt;strong&gt;I&amp;#39;ve managed to turn unhappy customers into Big Fans about 85% of the time: simply by asking questions and trying to care&lt;/strong&gt; instead of following some old-school, outdated tome.&lt;/p&gt;
&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PZzbWDi8bww:AFQQEzd8wQo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PZzbWDi8bww:AFQQEzd8wQo:Q8R26LmAkSY"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=PZzbWDi8bww:AFQQEzd8wQo:Q8R26LmAkSY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PZzbWDi8bww:AFQQEzd8wQo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=PZzbWDi8bww:AFQQEzd8wQo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/wekeroad/EeKc?a=PZzbWDi8bww:AFQQEzd8wQo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/wekeroad/EeKc?i=PZzbWDi8bww:AFQQEzd8wQo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/wekeroad/EeKc/~4/PZzbWDi8bww" height="1" width="1"/&gt;</content>
    <published>2013-02-18T10:00:00-05:00</published>
    <updated>2013-02-18T10:00:00-05:00</updated>
  <feedburner:origLink>http://wekeroad.com/2013/02/18/customer-service-vs-serving-the-customer</feedburner:origLink></entry>
</feed><!-- page cached: 2013-13-05 15:25:26 -->
