<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Fractal Banana]]></title>
  <link href="http://fractalbanana.com/atom.xml" rel="self"/>
  <link href="http://fractalbanana.com/"/>
  <updated>2017-12-21T09:35:50-08:00</updated>
  <id>http://fractalbanana.com/</id>
  <author>
    <name><![CDATA[Brad Urani]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Rails Anti-Patterns: How Not to Design Your Database]]></title>
    <link href="http://fractalbanana.com/blog/2017/12/21/rails-anti-patterns-how-not-to-design-your-database/"/>
    <updated>2017-12-21T09:33:37-08:00</updated>
    <id>http://fractalbanana.com/blog/2017/12/21/rails-anti-patterns-how-not-to-design-your-database</id>
    <content type="html"><![CDATA[<p>My Talk from Windy City Rails 2017.</p>

<p>When designing a database for your Ruby on Rails application, what looks like the best solution can be a trap. Join us as we expose these database anti-patterns. We’ll model shoes at a fictional shoe store and show both a naive design and more flexible alternatives. We’ll discuss how to represent trees, and see that the simplest solution is the slowest and hardest to query. We’ll explore scenarios where a polymorphic relationship looks like a good choice, but isn’t (and one where it is). Learn these pitfalls before falling into them, and save yourself from sloppy querying and poor performance.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/hVaj1ZIKv4k" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Arcane Art of Error Handling]]></title>
    <link href="http://fractalbanana.com/blog/2017/12/21/the-arcane-art-of-error-handling/"/>
    <updated>2017-12-21T09:27:49-08:00</updated>
    <id>http://fractalbanana.com/blog/2017/12/21/the-arcane-art-of-error-handling</id>
    <content type="html"><![CDATA[<p>My Talk from RailsConf 2017, The Arcane Art of Error Handling. Enjoy!</p>

<p>With complexity comes errors, and unexpected errors lead to unexpected unhappiness. Join us and learn how to add contextual data to errors, design error hierarchies, take charge of control flow, create re-usable error handlers, and integrate with error reporting solutions. We&rsquo;ll talk about recoverable versus irrecoverable errors and discuss how and how not to use exceptions. From internationalization to background jobs, we&rsquo;ll cover the gamut. Regardless of your Rail proficiency, you&rsquo;ll learn why expecting the unexpected makes for happier developers, happier businesses and happier users.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/9R4wlyWBP1k" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[My Ruby Story]]></title>
    <link href="http://fractalbanana.com/blog/2017/05/03/my-ruby-story/"/>
    <updated>2017-05-03T00:45:26-07:00</updated>
    <id>http://fractalbanana.com/blog/2017/05/03/my-ruby-story</id>
    <content type="html"><![CDATA[<p>Here&rsquo;s My Ruby Story, a 45 minute interview where I talk about how I started
programming, my introduction to Ruby, California and why it&rsquo;s special, React.js
and it&rsquo;s pitfalls and more!</p>

<p><a href="https://devchat.tv/ruby-rogues/my-ruby-story-brad-urani"><strong>My Ruby Story, Brad Urani</strong></a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Jaywalking in Traffic: Safe Migrations at Scale]]></title>
    <link href="http://fractalbanana.com/blog/2017/05/03/jaywalking-in-traffic-safe-migrations-at-scale/"/>
    <updated>2017-05-03T00:36:31-07:00</updated>
    <id>http://fractalbanana.com/blog/2017/05/03/jaywalking-in-traffic-safe-migrations-at-scale</id>
    <content type="html"><![CDATA[<p>This is the video from <a href="https://www.socallinuxexpo.org/scale/15x">Scale15x</a>. My
talk starts at <strong>3:42:00</strong>. I talk about the challenges we face at <a href="https://procore.com">Procore</a>
migrating our database at scale under heavy load, day in and day out. And about
the gem I wrote, <a href="https://www.github.com/procore/handcuffs">handcuffs</a>, that is
one of the tools that enables our team to accomplish this feat. Enjoy!</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/mxmZv9xkc8s" frameborder="0" allowfullscreen></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Building Huge Web Apps]]></title>
    <link href="http://fractalbanana.com/blog/2017/05/03/building-huge-web-apps/"/>
    <updated>2017-05-03T00:27:18-07:00</updated>
    <id>http://fractalbanana.com/blog/2017/05/03/building-huge-web-apps</id>
    <content type="html"><![CDATA[<p>Here&rsquo;s the video from my talk at <a href="https://2016.rubyconf.tw/">RubyConf Taiwan</a>,
Building Huge Web Apps, Ruby on Rails at 1,000,000 Lines of Code</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/0EpgXNbC6x4" frameborder="0" allowfullscreen></iframe>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Gitfile: A Package Manager for Git Repos]]></title>
    <link href="http://fractalbanana.com/blog/2016/08/15/gitfile-a-package-manager-for-git-repos/"/>
    <updated>2016-08-15T23:38:53-07:00</updated>
    <id>http://fractalbanana.com/blog/2016/08/15/gitfile-a-package-manager-for-git-repos</id>
    <content type="html"><![CDATA[<p>I just released the beta version of a new open-source project I put together
over the weekend. <a href="https://github.com/bradurani/Gitfile">Gitfile</a> is a
lightweight package manager for installing and updating software from git repos.
It&rsquo;s great for installing odd things that live on GitHub and can&rsquo;t be installed
with typical package managers.
I built it because there are several things I wanted to include with my <a href="https://github.com/bradurani/bradrc">dotfiles</a>
that can&rsquo;t be installed with brew, gem, npm, pip or any other common package
managers. They&rsquo;re things like <a href="https://github.com/thewtex/tmux-mem-cpu-load">tmux plugins</a>, <a href="https://github.com/tpope/rbenv-ctags">rbenv plugins</a>, and <a href="https://github.com/olivierverdier/zsh-git-prompt">zsh plugins</a> that I want to
install automatically and update with a single command.<br/>
Gitfile is written in <a href="" title="https://golang.org/">Go</a> and I&rsquo;d love contributions and
⭐️s. This was my first experience programming in Go. I haven&rsquo;t been that
interested in learning it because I&rsquo;m so fond of the newer functional languages,
but this type of cross-platform command line app seemed like the right use case.
I got started in no time, and became productive more quickly than I ever have
with any other language. For me, it&rsquo;s a limited use case tool because it&rsquo;s
missing a lot of things I rely on when building big production apps. For
utilities like this though, I&rsquo;d use it again.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Ecto vs. ActiveRecord Video From PolyConf]]></title>
    <link href="http://fractalbanana.com/blog/2016/08/15/ecto-vs-activerecord-video-from-polyconf/"/>
    <updated>2016-08-15T23:33:19-07:00</updated>
    <id>http://fractalbanana.com/blog/2016/08/15/ecto-vs-activerecord-video-from-polyconf</id>
    <content type="html"><![CDATA[<p>I was recently honored to be invited to speak at <a href="http://polyconf.com/">PolyConf</a> in Poznań, Poland. It was the best conference I&rsquo;ve ever attended. If you ever get a chance, go to this one.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/96YwY7Lld0Q" frameborder="0" allowfullscreen></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Active Record vs. Ecto: A Tale of 2 ORMs]]></title>
    <link href="http://fractalbanana.com/blog/2016/06/28/active-record-vs-ecto-a-tale-of-2-orms/"/>
    <updated>2016-06-28T22:42:10-07:00</updated>
    <id>http://fractalbanana.com/blog/2016/06/28/active-record-vs-ecto-a-tale-of-2-orms</id>
    <content type="html"><![CDATA[<p>The video for my RailsConf 2016 talk is up on YouTube</p>

<p>They bridge your application and your database. They&rsquo;re object-relational mappers, and no two are alike. Join us as we compare ActiveRecord from Rails with Ecto from Phoenix, a web framework for Elixir. Comparing the same app implemented in both, we&rsquo;ll see why even with two different web frameworks in two different programming languages, it&rsquo;s the differing ORM designs that most affect the result. This tale of compromises and tradeoffs, where no abstraction is perfect, will teach you how to pick the right ORM for your next project, and how to make the best of the one you already use.</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/_wD25uHx_Sw" frameborder="0" allowfullscreen></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Changing the Unchangeable: The Hows and Whys of Immutable Data Structures]]></title>
    <link href="http://fractalbanana.com/blog/2015/12/01/changing-the-unchangeable-the-hows-and-whys-of-immutable-data-structures/"/>
    <updated>2015-12-01T02:30:52-08:00</updated>
    <id>http://fractalbanana.com/blog/2015/12/01/changing-the-unchangeable-the-hows-and-whys-of-immutable-data-structures</id>
    <content type="html"><![CDATA[<p>The video from my <a href="http://rubyconf.org">RubyConf</a>  presentation is up. Enjoy!</p>

<p>  <iframe width="560" height="315" src="https://www.youtube.com/embed/gTClDj9Zl1g" frameborder="0" allowfullscreen></iframe></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Live Coding Building a Game in Elm]]></title>
    <link href="http://fractalbanana.com/blog/2015/12/01/live-coding-building-a-game-in-elm/"/>
    <updated>2015-12-01T01:55:03-08:00</updated>
    <id>http://fractalbanana.com/blog/2015/12/01/live-coding-building-a-game-in-elm</id>
    <content type="html"><![CDATA[<p>I live coded a game recently using my new obsession: <a href="http://elm-lang.org">Elm</a></p>

<p>If you haven&rsquo;t tried Elm, you&rsquo;re missing out. It&rsquo;s a purely functional reactive programing language that compiles to JavaScript for front end web development. There are 4 hours of video from on <a href="http://livecoding.tv">livecoding.tv</a> split into 4 parts:<br/>
<a href="https://www.livecoding.tv/video/building-a-game-in-elm-pt-1a/">Part 1a</a><br/>
<a href="https://www.livecoding.tv/video/building-a-game-in-elm-pt-1b/">Part 2b</a><br/>
<a href="https://www.livecoding.tv/video/building-a-game-in-elm-2/">Part 2</a><br/>
<a href="https://www.livecoding.tv/video/building-a-game-in-elm-3/">Part 3</a></p>

<p>The finished program is on <a href="https://github.com/bradurani/connect-four-elm">GitHub</a>. The master branch is the completed program with a computer player AI using the minimax algorithm. branches <a href="https://github.com/bradurani/connect-four-elm/tree/part-1">part-1</a> and <a href="https://github.com/bradurani/connect-four-elm/tree/part-2">part-2</a> contain the code I wrote during the livecoding sessions</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Commands, Services and Logic: An Action-Based Class Design for Non-trivial Rails Applications]]></title>
    <link href="http://fractalbanana.com/blog/2015/09/17/commands-services-and-logic-an-action-based-class-design-for-non-trivial-rails-applications/"/>
    <updated>2015-09-17T23:32:13-07:00</updated>
    <id>http://fractalbanana.com/blog/2015/09/17/commands-services-and-logic-an-action-based-class-design-for-non-trivial-rails-applications</id>
    <content type="html"><![CDATA[<p>A video of my talk at the <a href="http://www.meetup.com/Santa-Barbara-on-Rails/events/224466080/">Santa Barbara Ruby on Rails Meetup</a>, where I demonstrate a novel class design I use for huge Ruby on Rails applications</p>

<iframe src="http://livestream.com/accounts/12766867/events/4083173/videos/96143345/player?autoPlay=false&height=360&mute=false&width=640" width="640" height="360" frameborder="0" scrolling="no"></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Carefully Composing Logic: Functional JavaScript Video]]></title>
    <link href="http://fractalbanana.com/blog/2015/09/16/carefully-composing-logic-functional-javascript-video/"/>
    <updated>2015-09-16T12:04:17-07:00</updated>
    <id>http://fractalbanana.com/blog/2015/09/16/carefully-composing-logic-functional-javascript-video</id>
    <content type="html"><![CDATA[<p>Here&rsquo;s my talk from the <a href='http://js.la'/>JS.LA meetup</a> on August 27th. This is easily my best performance ever. Enjoy!</p>

<iframe src="https://player.vimeo.com/video/138163463" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>


<p> <p><a href="https://vimeo.com/138163463">Carefully Composing Logic: Functional JavaScript</a> from <a href="https://vimeo.com/jsla">JSLA</a> on <a href="https://vimeo.com">Vimeo</a>.</p></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Turning the Tables: How to Get Along With Your Object-Relational Mapper]]></title>
    <link href="http://fractalbanana.com/blog/2015/09/12/turning-the-tables-how-to-get-along-with-your-object-relational-mapper/"/>
    <updated>2015-09-12T21:15:16-07:00</updated>
    <id>http://fractalbanana.com/blog/2015/09/12/turning-the-tables-how-to-get-along-with-your-object-relational-mapper</id>
    <content type="html"><![CDATA[<p>ORMs can be tricky to work with. They give us conveniece, but with significant trade-offs. I&rsquo;ve published a post a medium on how to improve your relationship with yours.</p>

<script async src="https://static.medium.com/embed.js"></script>


<p><a class="m-story" data-collapsed="true" href="https://medium.com/@bradurani/turning-the-tables-how-to-get-along-with-your-object-relational-mapper-e5d2d6a76573">Turning the Tables: How to Get Along with your Object-Relational Mapper</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Improving Your Web App With Functional Object-Oriented Design]]></title>
    <link href="http://fractalbanana.com/blog/2015/09/05/improving-your-web-app-with-functional-object-oriented-design/"/>
    <updated>2015-09-05T15:45:53-07:00</updated>
    <id>http://fractalbanana.com/blog/2015/09/05/improving-your-web-app-with-functional-object-oriented-design</id>
    <content type="html"><![CDATA[<p>I&rsquo;ve cooked up a little post about barbecue, beer and object-oriented design just in time for labor day. This one has been incubating for a while and is the subject of a talk I&rsquo;ve been giving that hopfully should make it online soon. I&rsquo;ve published it on Medium, Enjoy!</p>

<script async src="https://static.medium.com/embed.js"></script>


<p><a class="m-story" data-collapsed="true" href="https://medium.com/@bradurani/improving-your-web-app-with-functional-object-oriented-design-5218f9732b74">Improving your Web App with Functional Object-Oriented Design</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[LaunchCode at Upside Promo Video]]></title>
    <link href="http://fractalbanana.com/blog/2015/03/14/launchcode-at-upside-promo-video/"/>
    <updated>2015-03-14T05:11:10-07:00</updated>
    <id>http://fractalbanana.com/blog/2015/03/14/launchcode-at-upside-promo-video</id>
    <content type="html"><![CDATA[<p>Here&rsquo;s a short video about me and two of our <a href="http://upsideadvisor.com">Upside</a> team members who were placed through <a href="https://www.launchcode.org/">LaunchCode</a>, a non-profit that places aspiring developers in their first jobs. I&rsquo;m so proud of these 2 young men and what we&rsquo;ve accomplished together.</p>

<div id="fb-root"></div>


<script>(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js = d.createElement(s); js.id = id;  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";  fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>


<div class="fb-post" data-href="https://www.facebook.com/video.php?v=846359705425978" data-width="466"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/video.php?v=846359705425978">Post</a> by <a href="https://www.facebook.com/launchcodestl">Launchcode</a>.</div></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Life After OO: Functional Ruby]]></title>
    <link href="http://fractalbanana.com/blog/2015/02/16/life-after-oo-functional-ruby/"/>
    <updated>2015-02-16T20:57:17-08:00</updated>
    <id>http://fractalbanana.com/blog/2015/02/16/life-after-oo-functional-ruby</id>
    <content type="html"><![CDATA[<p>Video podcast on Functional Ruby for <a href="http://codecaststl.com/">CodeCast</a> by <a href="http://codecaststl.com/">STLTechTalk</a>. Big thank you to <a href="https://twitter.com/jjhammondmusic">JJ</a>, <a href="https://twitter.com/jjhammondmusic">Kevin</a> and <a href="https://twitter.com/n_f_e">Gus</a>. Sorry I cursed so much :)</p>

<iframe width="560" height="315" src="https://www.youtube.com/embed/S1jxHf2TZGA" frameborder="0" allowfullscreen></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Test-Driven JavaScript With Jasmine Video]]></title>
    <link href="http://fractalbanana.com/blog/2015/02/16/test-driven-javascript-with-jasmine-video/"/>
    <updated>2015-02-16T20:48:30-08:00</updated>
    <id>http://fractalbanana.com/blog/2015/02/16/test-driven-javascript-with-jasmine-video</id>
    <content type="html"><![CDATA[<p>InfoQ has published a video of my presentation on JavaScript TDD with Jasmine from the 2014 Kansas City Developer Conference.</p>

<h3><a href="http://www.infoq.com/presentations/jasmine-unit-tests-javascript">Watch on InfoQ >></a></h3>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Talking Ruby on Rails on CodeCast]]></title>
    <link href="http://fractalbanana.com/blog/2014/08/16/talking-ruby-on-rails-on-codecast/"/>
    <updated>2014-08-16T11:54:39-07:00</updated>
    <id>http://fractalbanana.com/blog/2014/08/16/talking-ruby-on-rails-on-codecast</id>
    <content type="html"><![CDATA[<p>On July 2nd I did this video podcast for <a href='http://stltechtalk.com/'>St. Louis Tech Talk</a>. The subject is mostly Ruby on Rails with some personal history and a discussion of <a href='http://www.launchcode.org/'>Launch Code</a> mixed in. There&rsquo;s no Ember talk despite what the title says, but don&rsquo;t worry, that will come later. Enjoy!</p>

<iframe width="560" height="315" src="http://fractalbanana.com//www.youtube.com/embed/asvqXFcOQqo" frameborder="0" allowfullscreen></iframe>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Review of Coursera's Functional Programming Principles in Scala]]></title>
    <link href="http://fractalbanana.com/blog/2014/06/30/review-of-courseras-functional-programming-principles-in-scala/"/>
    <updated>2014-06-30T07:32:09-07:00</updated>
    <id>http://fractalbanana.com/blog/2014/06/30/review-of-courseras-functional-programming-principles-in-scala</id>
    <content type="html"><![CDATA[<p>In case you’ve been asleep, functional programming is the new standard in modern programming language and application design. To those of us who have been using languages with functional features, such as Ruby, C# and JavaScript, it doesn’t seem at first glance like a major paradigm shift. This is especially true since functional design is not mutually exclusive to object-oriented design (in fact as the Scala language proves, they complement each other quite nicely). However when you apply functional principles universally using a functional language, it becomes clear that FP is a significant step forward from the Java-style object-heavy approach that it is slowly replacing.<br/>
I signed up for Functional Programming Principles in Scala on Coursera to experience for myself the new secret sauce having heard that the course is outstanding. I’m happy to say that it was outstanding beyond my expectations. It’s a perfectly designed introduction and easily the most rewarding online class I’ve ever taken.<br/>
Perhaps it shouldn’t be a surprise that the course is so good. It’s taught by Scala’s creator, Martin Odersky. What <em>is</em> surprising is that throughout the course, he talks very little about functional programming principles at a high level. Instead he teaches by example starting with simple recursive algorithm problems and ending with a really clever algorithmic game solver. In between we solved some classic computer science problems &ndash; problems I had solved before in school &ndash; using pure FP in a way that highlights where the functional solutions improve on the older procedural solutions. It’s in the progression of increasingly more involved assignments &ndash; which stepwise introduce language features and concepts &ndash; that the class succeeds so cleverly. One is never instructed to use pure functional programming, but rather arrives there naturally as one technique begets the next and the assignments grow in complexity. If you’re autodidactic like me, and generally wary of formal education, you’ll appreciate Professor Odersky’s subtle approach.</p>

<p>So what did I learn?</p>

<ul>
<li>Recursion combined with immutable linked lists is the best way to do list operations</li>
<li>Pattern matching is the hottest language feature since lambdas. They’re super-charged conditionals</li>
<li>Lazy sequences and lazy evaluation are a breeze when they’re built into the language</li>
<li>Often when I’m using a list, I should be using a set</li>
<li>Tuples do serve a purpose when your language is strongly typed</li>
<li>You can have strong typing without excessive boilerplate</li>
<li>Tail call optimization makes a language more powerful (I’m looking at you, Ruby)</li>
<li>Accessing instance variables from within methods is safe if they’re immutable</li>
<li>Encapsulation with higher-order functions is cleaner than delegation</li>
<li>Side-effect free code weakens the case for test doubles</li>
</ul>


<p>Whether you have or have not been exposed to functional programming, this is a great course. If you’ve ever studied recursive algorithms and enjoyed it, this course will rekindle your excitement by giving you new more powerful ways to solve old problems. Be prepared to fall in love with the Scala language: it fixes most of what’s wrong with Java and augments it with new capabilities that lead to simply better code. While it is not addressed in this course, I’m looking forward to seeing how functional programming improves concurrent operations in distributed environments. Fortunately that’s the subject of Dr. Odersky&rsquo;s <a href="https://www.coursera.org/course/reactive">next class</a> which you can bet I’ll be taking.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Reviews of 5 JavaScript Books]]></title>
    <link href="http://fractalbanana.com/blog/2014/04/23/reviews-of-5-javascript-books/"/>
    <updated>2014-04-23T04:06:30-07:00</updated>
    <id>http://fractalbanana.com/blog/2014/04/23/reviews-of-5-javascript-books</id>
    <content type="html"><![CDATA[<p><strong>TL;DR:</strong> Start with <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/">The Good Parts</a>, then read <a href="http://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp/0596806752/">JavaScript Patterns</a> if you’re hungry for more. Read <a href="http://www.amazon.com/Functional-JavaScript-Introducing-Programming-Underscore-js/dp/1449360726/">Functional JavaScript</a> when you’re ready to have your mind blown and learn a new way to program. <a href="http://www.amazon.com/Testable-JavaScript-Mark-Ethan-Trostler/dp/1449323391/">Testable JavaScript</a> and <a href="http://www.amazon.com/JavaScript-Testing-Jasmine-Behavior-Driven-Development/dp/1449356370/">JavaScript Testing with Jasmine</a> can be skipped provided you know it’s a great idea to use event hubs and write unit tests.</p>

<p>18 years after I wrote my first line of JavaScript (Netscape 2.0 for Macintosh was released in March of 1996), I decided it was time to catch up on the latest best practices and fill in the gaps of my dated understanding of JavaScript. I guess I’m late to the JavaScript renaissance, but it only took 5 books to bring me up to speed. The result? A very slick open source micro-framework called Ranger (<a href="http://www.github.com/bradurani/ranger">http://www.github.com/bradurani/ranger</a>) that I’ll blog about as soon as I’ve documented it. Here’s how I got there</p>

<h2>Review: <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/">JavaScript the Good Parts</a> &ndash; Douglas Crockford</h2>

<p>The best programming books are the ones that show you examples of what NOT to do. This is just such a book. In fact, it could just as easily be called “JavaScript the Bad Parts”, but I suppose it wouldn’t sell as well. It’s a classic, and it’s the first book you should read when you’re ready to admit that loose collections of barely organized jQuery do not an application organize.<br/>
It’s opinionated &ndash; to a fault in fact. And while it’s heavy on language mechanics with nary a hint on how to put them into practice, that’s no excuse for skipping it. It’s barely 100 pages, and it sets the stage for everything that comes after it. JavaScript is a quirky language and its proclivities are easy to forget. You have to read about them several times and experiment if you’re going to remember them. Crockford’s book is the perfect first exposure, plus you can name drop him during any job interview and get instant brownie points.<br/>
Read it, digest it, read it again. Try out his linter, JSLint, then ditch it for the less opinionated JSHint. Only when you’re fully steeped in the bad parts, should you move on to something more imminently practical. It’s also worth checking out his video on the subject <a href="https://www.youtube.com/watch?v=hQVTIJBZook">here</a>, but watching it doesn’t excuse you from reading the book.</p>

<h2>Review: <a href="http://www.amazon.com/Testable-JavaScript-Mark-Ethan-Trostler/dp/1449323391/">Testable JavaScript</a> &ndash; Mark Ethan Trostler</h2>

<p>I had high hopes for this book but most of it wasn’t useful to me. the first few chapters, however, were worth the price of admission. Chapter 1 is the perfect exposition and eminently quotable :<br/>
“Your ideas are unique, your code is not”<br/>
“Testable JavaScript is your gateway to sanity”<br/>
“Unit tests are a developer’s first line of defense”<br/>
But it’s chapter 2 where the value of this books lies. Here we study command / query separation, function decomposition, and scoping for testability. There are great discussions of cyclomatic complexity, fan in and fan out, and a complete Linnean breakdown of the genera of coupling. Most impressive indeed, especially since we also get a full dose of dependency injection (one of my favorite subjects) and a comprehensive look at documentation tools.<br/>
Chapter 3 makes a convincing case for event-based architecture. So convincing, in fact, that I now use event-based architectures for everything I build with JavaScript (and I’m not talking about click events and other jQuery gimmies, I was already using those). The event hub example (the most important pattern in JavaScript architecture?), is a server-side example for node.js, but the point is still made, even if you only write JS for browsers.<br/>
Chapter 4 mixes great advice about unit-testing, with annoying examples using the YUI framework, which I don’t use (<a href="http://jasmine.github.io/">Jasmine</a> is better). It has a great breakdown of mocks, stubs and spies, then veers off into tools such as PhantomJS (a headless browser) and Selenium (a functional testing tool). Pick and choose here, there are useful bits between the tool focused parts.<br/>
The rest of the book was useful, or maybe useless. I’m not sure, I didn’t read it. It’s about tools for code coverage and load testing and automation and things only NodeJS developers care about. Read it if you want, but it’s probably already out-of-date. The first 3.5 chapters are very good though.</p>

<h2>Review: <a href="http://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp/0596806752/">JavaScript Patterns</a> &ndash; Stoyan Stefanov</h2>

<p>This book picks up where “The Good Parts” leaves off. Actually, it starts by repeating everything from “The Good Parts”, which is great, because you forgot those things, and need to see them again. What comes after is what’s really useful: page after of page of practical, usable design patterns that you can use in your own applications. You get 5 versions of inheritance, a panoply of object construction variations, and an almost complete rehash of the <a href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/">Gang of Four classics</a>. Best though, are the module, namespace and sandbox patterns, which have spawned many micro-frameworks. <br/>
This is solid, usable stuff. Even if you don’t write your own framework (this book gives you the pieces), these lessons help you identify patterns you see in the wild, and the first step to becoming an application architect is identifying patterns by name. If you don’t have time to read the whole book (shame on you), there’s a nice blog post <a href="http://addyosmani.com/largescalejavascript/">here</a> that summerizes many of the more useful patterns.</p>

<h2>Review: <a href="http://www.amazon.com/JavaScript-Testing-Jasmine-Behavior-Driven-Development/dp/1449356370/">JavaScript Testing with Jasmine</a> &ndash; Evan Hahn</h2>

<p>Jasmine is stellar<br/>
This book is out of date now<br/>
Skip it and read <a href="http://jasmine.github.io/">docs</a></p>

<h2>Review: <a href="http://www.amazon.com/Functional-JavaScript-Introducing-Programming-Underscore-js/dp/1449360726/">Functional JavaScript</a> &ndash; Michael Fogus</h2>

<p>Ok LISPers, Scala Jockeys and Clojurites, you’ve got the jump on me here. I mean I know about lambdas, map, reduce and filter, but those are tools for writing concise functions, not architectures for entire applications&hellip; or so I thought. Let me back up. I’ve known about functional programming for many years, and being a former C# dev, I know that lambdas are a way of life. However I never knew exactly how to translate those concepts to architectural patterns. I’d been prosthelytizing the trees but missing the forest.<br/>
Functional programming is about composing functions to create pipelines for data transformation, and if you haven’t read a book like this, or practiced it yourself, it’s not easily intuited. It’s functions instead of loops, functions instead of ifs, functions returning functions and taking functions as arguments. It’s not just about pulling punchy one-liners like you Rubyists gloat about. Functional programming is a lifestyle, a higher-order of being where everything’s a function and inheritance only marginally useful.<br/>
That JavaScript is functional at all is a small miracle. It happened sometime between 2:00 am and 4:00 am in February of 1996 &ndash; when Brendan Eich was blessed with an ephiphany, imparted by angels like an annunciation on a <a href="http://en.wikipedia.org/wiki/M%C3%A9rode_Altarpiece">gothic triptych</a>: functions should be first class objects. He took the road less-traveled &ndash; a sharp turn off the highway towards Java-like languages that the world was hell-bent on following at the time. JavaScript was not a complete failure, having inherited just enough LISP to make it really useful.<br/>
The build up is slow. Ravel’s Bolero, but it’s not a sex scene. We hear readable, reusable code composed of tiny simple functions &ndash; short sharp drum beats that build to form a symphony. It’s complexity simplified to the simplest it can be, and not a drop simpler.<br/>
And what’s this I finally understand? Monads! They’re not burritos, nor train cars, nor spacesuits nor any other obfuscating metaphor. They’re abstractions used to augment primitives with additional processing rules as they travel through data transformation pipelines. “You had the power all along, my dear”, said the good witch to Dorothy, “and you realized it on page 185”. <br/>
There is life after inheritance. There’s more than OO. Now pass me that function and I’ll give you one back. Recurse until you catch the final burrito, the final train car, the final space suit. Peal back the foil and behold the result. The new JavaScript is functional. Now where do I learn more about Scala?</p>
]]></content>
  </entry>
  
</feed>
