<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ThoughtStream.new :derick_bailey</title>
	
	<link>http://lostechies.com/derickbailey</link>
	<description>Better Than Yesterday</description>
	<lastBuildDate>Sun, 28 Apr 2013 21:58:46 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DerickBailey" /><feedburner:info uri="derickbailey" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>31.514067</geo:lat><geo:long>-97.235465</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>DerickBailey</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Slap-Slides: Arduino Powered Veggie Chopper Slide Deck Controller</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/5dCBncrac_I/</link>
		<comments>http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/#comments</comments>
		<pubDate>Sat, 27 Apr 2013 20:31:39 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JohnnyFive]]></category>
		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1095</guid>
		<description>A few weeks ago I half-jokingly tweeted about my desire to turn a SlapChop in to a presentation controller … like I said … &amp;#8220;half-jokingly&amp;#8221; I give you the Slap-Slides, proof of concept! (no audio) &amp;#38;amp;amp;amp;amp;amp;lt;iframe&amp;#38;amp;amp;amp;amp;amp;gt; The code is written&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>A few weeks ago I half-jokingly tweeted about my desire to turn a SlapChop in to a presentation controller</p>
<p><img title="NewImage.png" src="http://lostechies.com/derickbailey/files/2013/04/NewImage.png" alt="NewImage" width="320" height="320" border="0" /></p>
<p>… like I said … &#8220;half-jokingly&#8221;</p>
<p>I give you the Slap-Slides, proof of concept! (no audio)</p>
<p><iframe src="http://www.youtube.com/embed/FIfhtPHMbtU" width="640" height="480" frameborder="0">&amp;amp;amp;amp;amp;amp;lt;iframe&amp;amp;amp;amp;amp;amp;gt;</iframe></p>
<p>The code is written in <a href="https://github.com/rwldrn/johnny-five">Johnny-Five</a>, running in NodeJS, connected to an <a href="http://www.amazon.com/gp/product/B00761NDHI/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00761NDHI&amp;linkCode=as2&amp;tag=avocadosoftwa-20">Arduino Nano</a>. I bought the cheapest veggie-chopper I could find at my local grocery store, ripped the blade out and mounted a 10k button on to the plate that the blade was previously on.</p>
<p>I&#8217;ll be soldering this in to a proper set up housed entirely in the veggie-chopper, and stabilizing the button (right now it fails every 2 or 3 clicks because of the mounting in the veggie chopper.</p>
<h2><strong>UPDATE: I have it nearly complete.</strong></h2>
<p>I have the primary circuitry soldered on to a component board, and some holes cut in the housing in order to clean up the entrance of a USB cable in to the chopper.</p>
<p>Here&#8217;s a series of pictures that show the components and assembly… making code skinny, one slap at a time :D</p>
<p><img title="IMAG1507.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1507.jpg" alt="IMAG1507" width="338" height="600" border="0" /></p>
<p><img title="IMAG1509.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1509.jpg" alt="IMAG1509" width="600" height="338" border="0" /></p>
<p><img title="IMAG1510.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1510.jpg" alt="IMAG1510" width="600" height="338" border="0" /></p>
<p><img title="IMAG1511.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1511.jpg" alt="IMAG1511" width="600" height="338" border="0" /></p>
<p><img title="IMAG1512.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1512.jpg" alt="IMAG1512" width="600" height="338" border="0" /></p>
<p><img title="IMAG1514.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1514.jpg" alt="IMAG1514" width="600" height="338" border="0" /></p>
<p><img title="IMAG1515.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1515.jpg" alt="IMAG1515" width="600" height="338" border="0" /></p>
<p><img title="IMAG1476.jpg" src="http://lostechies.com/derickbailey/files/2013/04/IMAG1476.jpg" alt="IMAG1476" width="600" height="338" border="0" /></p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=5dCBncrac_I:RpO04T9gV1Q:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=5dCBncrac_I:RpO04T9gV1Q:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=5dCBncrac_I:RpO04T9gV1Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=5dCBncrac_I:RpO04T9gV1Q:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=5dCBncrac_I:RpO04T9gV1Q:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=5dCBncrac_I:RpO04T9gV1Q:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=5dCBncrac_I:RpO04T9gV1Q:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=5dCBncrac_I:RpO04T9gV1Q:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/5dCBncrac_I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/04/27/slap-slides-proof-of-concept/</feedburner:origLink></item>
		<item>
		<title>Prosthetics And Orthotics: Building Backbone Plugins</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/4RossBE0bL0/</link>
		<comments>http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/#comments</comments>
		<pubDate>Mon, 22 Apr 2013 13:10:13 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Backbone]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Marionette]]></category>
		<category><![CDATA[Principles and Patterns]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1091</guid>
		<description>A long time ago, in a galaxy far, far away…  It was almost a year ago that I announced a book on building Backbone.js plugins. Since then… nothing. Well I finally got tired of sitting on it and over the&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>A long time ago, in a galaxy far, far away… </p>
<p>It was almost a year ago that <a href="http://lostechies.com/derickbailey/2012/07/06/im-wring-a-book-on-building-backbone-plugins/">I announced a book</a> on building Backbone.js plugins. Since then… nothing. Well I finally got tired of sitting on it and over the weekend I made a bunch of edits, cleaned up a lot and released the first 6 chapters of the book via Leanpub!</p>
<p><a href="https://leanpub.com/building-backbone-plugins">https://leanpub.com/building-backbone-plugins</a></p>
<blockquote>
<p>Learn the how and why of building plugins for Backbone.js. This book provides first hand lessons learned, best practices, and patterns for building flexible add-ons and frameworks components, based on my experience &#8211; both success and failure &#8211; from the last few years of working with Backbone and building plugins for it!</p>
</blockquote>
<h2>On Buidling Backbone Plugins</h2>
<p>I&#8217;ve built more than a handful of Backbone related tools, plugins and add-ons in my time working with it. From nearly the beginning of my exploration and use of Backbone, in fact, I&#8217;ve been looking for and developing better methods of handling common tasks and solving the same problems. This has led me to create plugins and frameworks such as <a href="http://github.com/derickbailey/backbone.marionette" target="_self">MarionetteJS</a> (Backbone.Marionette), <a href="http://github.com/derickbailey/backbone.picky" target="_self">Backbone.Picky</a>, <a href="http://github.com/derickbailey/backbone.modelbinding" target="_self">Backbone.ModelBinding</a> and many more &#8211; some published on my Github account, many unpublished and created for a specific client application.</p>
<p>In all of the plugins and add-ons that I&#8217;ve built, there have been lessons learned. The continued success of frameworks like MarionetteJS provide many useful insights in to how to properly create view layers and additional object types that support the creation of large Backbone application. Equally as valuable, though, failures such as Backbone.Modelbinding provide insight in to the patterns and practices that should be avoided when creating add-ons. Or, at least, they illustrate some of the scenarios and circumstances in which these patterns and practices fall apart.</p>
<h2>A Work In Progress</h2>
<p>This book is a work in progress, with 6 chapters roughly completed at this time, 3 or 4 additional chapters in rough draft, and one or two chapters planned beyond that. Expect this book to change over time, with edits and additional chapters being added. Early adopters will be able to purchase the book at a discounted price. The amount of demand I am seeing from early adopers will largely determine the schedule that I keep for additional releases, and the eventual price that is charged for the finished product.</p>
<p><a href="https://leanpub.com/building-backbone-plugins">https://leanpub.com/building-backbone-plugins</a> </p>
<p> </p>
<p>Be sure to follow the book on twitter for updates, as well: <a href="http://twitter.com/backboneplugins">@BackbonePlugins</a></p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=4RossBE0bL0:aY3FNXI9LvM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=4RossBE0bL0:aY3FNXI9LvM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=4RossBE0bL0:aY3FNXI9LvM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=4RossBE0bL0:aY3FNXI9LvM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=4RossBE0bL0:aY3FNXI9LvM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=4RossBE0bL0:aY3FNXI9LvM:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=4RossBE0bL0:aY3FNXI9LvM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=4RossBE0bL0:aY3FNXI9LvM:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/4RossBE0bL0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/04/22/prosthetics-and-orthotics-building-backbone-plugins/</feedburner:origLink></item>
		<item>
		<title>A First Look At My Arduino BBQ Thermometer</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/yjuZaXXEoEE/</link>
		<comments>http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 17:01:07 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[KendoUI]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1089</guid>
		<description>I&amp;#8217;ve uploaded a first look at the Arduino powered BBQ thermometer and software that I&amp;#8217;m building. It&amp;#8217;s using an Arduino Uno with Ethernet shield.  The probe is a 100K &amp;#8220;meat probe&amp;#8221; (aka &amp;#8220;thermistor&amp;#8221;) that I took from a store bought&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded a first look at the <a href="http://arduino.cc/">Arduino</a> powered BBQ thermometer and software that I&#8217;m building. It&#8217;s using an <a href="http://www.amazon.com/gp/product/B006H06TVG/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B006H06TVG&amp;linkCode=as2&amp;tag=avocadosoftwa-20">Arduino Uno</a> with <a href="http://www.amazon.com/gp/product/B006UT97FE/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B006UT97FE&amp;linkCode=as2&amp;tag=avocadosoftwa-20">Ethernet shield</a>. </p>
<p><iframe src="http://www.youtube.com/embed/29qBI7IWFl4" width="640" height="480" frameborder="0"></iframe></p>
<p>The probe is a 100K &#8220;meat probe&#8221; (aka &#8220;thermistor&#8221;) that I took from a store bought meat thermometer. Something like <a href="http://www.amazon.com/gp/product/B0048GD8RY/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0048GD8RY&amp;linkCode=as2&amp;tag=avocadosoftwa-20">this replacement probe</a> would work great. It&#8217;s a bit of a guessing game as to wether the probe is a 10k or 100k Ohm probe. I tried 10, 100, 1k, 10k and finally 100k resistors in my thermistor setup. You can read about thermistor setup on <a href="http://playground.arduino.cc/ComponentLib/Thermistor">the Arduino playground</a>, and at <a href="http://www.hacktronics.com/Tutorials/arduino-thermistor-tutorial.html">Hacktronics</a>.</p>
<p>The Arduino code produces a JSON document when I make an HTTP request to it. The software is built with <a href="http://www.kendoui.com/mobile">Kendo UI Mobile</a>, and reads the JSON document on a 1 second interval.</p>
<p>I&#8217;ll be blogging about this more, and hopefully soon, with plans on going through a step by step &#8220;how I learned&#8221; series &#8211; at least, that&#8217;s the plan. For now, this little teaser video should give you a good idea of what can be done with an Arduino, some simple parts from a store, and a mobile app framework like <a href="http://www.kendoui.com/mobile">Kendo UI Mobile</a>. :)</p>
<p>… I need to learn how to optimize my C code for battery life. I&#8217;ve run that 9volt battery maybe 10 or 20 minutes, total, and it&#8217;s already dead. :P</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=yjuZaXXEoEE:DlVsKPD6nss:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=yjuZaXXEoEE:DlVsKPD6nss:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=yjuZaXXEoEE:DlVsKPD6nss:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=yjuZaXXEoEE:DlVsKPD6nss:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=yjuZaXXEoEE:DlVsKPD6nss:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=yjuZaXXEoEE:DlVsKPD6nss:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=yjuZaXXEoEE:DlVsKPD6nss:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=yjuZaXXEoEE:DlVsKPD6nss:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/yjuZaXXEoEE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/</feedburner:origLink></item>
		<item>
		<title>MarionetteJS v1.0</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/XC0CqhEo0XM/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/#comments</comments>
		<pubDate>Mon, 25 Mar 2013 13:19:08 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Backbone]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Marionette]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1080</guid>
		<description>Hot on the heels of the Backbone v1.0 release, I present MarionetteJS v1.0! I quietly released it over the weekend, and I&amp;#8217;m glad I did. I already had a bug report and have released v1.0.1 to fix it. :D The&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>Hot on the heels of the <a href="http://ashkenas.com/backbonejs-1.0/">Backbone v1.0 release</a>, I present <a href="http://marionettejs.com">MarionetteJS v1.0</a>!</p>
<p>I quietly released it over the weekend, and I&#8217;m glad I did. I already had a bug report and have released v1.0.1 to fix it. :D</p>
<p>The last few years of working on Marionette have been tremendously fun, exciting, frustrating at time, and have provided much more work and opportunity for me than I had ever imagined. I started this project out of need, and hoped that it might help a few people out &#8211; at least show them what could be done and give them ideas on how to do it. I never expected that this project would have 1/10th the number of stars it has on Github, or that this project would lead to working with dozens of amazing companies, travelling around the world, create new friendships, and land me some awesome speaking opportunities on podcasts and at conferences! </p>
<h2>What&#8217;s New</h2>
<p>There&#8217;s a ton of new things that have happened since I started the 1.0 release candidates. And actually, going in to &#8220;release candidate&#8221; model was probably the worst mistake I&#8217;ve made with Marionette, so far. I had far too many breaking changes, far too many times for it to really be a release candidate series. But things are stable now, and have been for a bit. There were a few additions and breaks in this release, some of which came from dependencies.</p>
<p>You can <strong>read the complete <a href="https://github.com/marionettejs/backbone.marionette/blob/master/changelog.md">change log</a> and <a href="https://github.com/marionettejs/backbone.marionette/blob/master/upgradeGuide.md">upgrade guide</a> in the repository</strong>, but I want to highlight a few of the notable things quickly.</p>
<h3>Backbone.Wreqr Updates</h3>
<p>Backbone.Wreqr is an integral part of Marionette and helps to provide a lot of the communication infrastructure for scaling applications. </p>
<p>In the latest release of Wreqr, I&#8217;ve renamed &#8220;addHandler&#8221; to &#8220;setHandler&#8221; for all Wreqr objects. There was confusion around the name &#8220;addHander&#8221; as it implied the ability to add multiple handlers. Since none of Wreqr allows multiple handlers for any one registered name, I changed this to &#8220;setHandler&#8221;. Anyone updating to Wreqr v0.2.0, along with Marionette v1.0.0, will need to account for this.</p>
<p>I&#8217;ve also made the commands somewhat persistent when there is no handler currently registered. Several people noted that they were running in to situations where a command needed to be executed, but due to the order of module loading being unpredictable, the handler wasn&#8217;t there. To fix this, a command can be executed whether or not the handler is available. As soon as the handler is available, the actual execution of the command will take place. Commands will persist in memory, for the life of the page. Refreshing the page or navigating to another page will destroy the not-yet-executed commands.</p>
<h3>Marionette.RegionManager</h3>
<p>One of the most requested features in recent times has been the ability to add and remove regions from layouts. I set out to solve this and realized that half of the code I needed was already in the Application object, and the other half was in the Layout object. So I consolidated most of this code in to a single object called RegionManager. Both the Application and Layout now use a RegionManager to manage their regions. This allows a more consistent way of managing the regions, and provides all of the add and remove functionality that is needed, on both.</p>
<h2>STICKERS!!!!</h2>
<p>WOOO! STICKERS!!! :D</p>
<p> <a href="http://www.devswag.com/products/marionette-stickers-4"><img title="marionette-sticker-detail.jpg" src="http://lostechies.com/derickbailey/files/2013/03/marionette-sticker-detail.jpg" alt="Marionette sticker detail" width="400" height="400" border="0" /></a></p>
<p>You can <a href="http://www.devswag.com/products/marionette-stickers-4">order yours from DevSwag</a>. They are providing order management and fulfillment for stickers, for Marionette and many other amazing open source projects.</p>
<h2>Semantic Versioning: A Goal</h2>
<p>I have a goal, moving forward, of using <a href="http://semver.org">Semantic Versioning</a> for the version numbers. I don&#8217;t think I can promise perfect semantic versions, though, for a few reasons. First off, this is my first project to hit v1.0. I know I&#8217;m going to make mistakes and screw up some little detail here and there. But for the most part, I plan on following semver. Secondly, and more importantly, though, Marionette relies on other libraries which have their own release cycles. Sometimes releases coincide. Other times they don&#8217;t. Sometimes they break Marionette, other times they don&#8217;t. This will make it challenging to follow semver.</p>
<h2>What&#8217;s Next?</h2>
<p>It&#8217;s been a whirlwind ride with near constant updates along the way. I&#8217;ve learned a ton about JavaScript and running an open source project. And this is the first time I&#8217;ve pushed an open source project to 1.0, so I&#8217;m sure there are still a ton of lessons left to learn.</p>
<p>There are still more than 50 tickets open in the Marionette repository, and a lot of things that I want to do to help re-stucture some of the ugly parts. I want to tear apart Modules, for example, and create separated namespacing, sub-applications and components. There are a lot of other feature requests and issues reported that need big changes, too. I&#8217;m looking forward to where Marionette will head, and hope to continue to build a strong community around it &#8211; including a more active core contributor team.).</p>
<h2>Thank You!</h2>
<p>Yes, it&#8217;s the grammy-award speech time! Someone start the &#8220;wrap it up&#8221; timer&#8230;</p>
<p><img title="NewImage.png" src="http://lostechies.com/derickbailey/files/2013/03/NewImage.png" alt="NewImage" width="275" height="183" border="0" /></p>
<p>I owe an especially large thanks to Jarrod Overson, Matt Briggs, Brian Mann and Tony Abou-Assaleh. These guys have been a great core team to bounce ideas around with, to help out with issues, and provide needed support and feedback. And to Ruben Vreeken for all the work he puts in to the Google group, answering questions. :)</p>
<p>Marionette wouldn&#8217;t be what it is without <a href="https://github.com/marionettejs/backbone.marionette/contributors">the amazing contributors</a>. Everyone that has contributed in any way &#8211; answering questions in the google group, sending issue reports, ideas, pull requests, writing blog posts and articles, screencasts, and talking at user groups and conferences. I&#8217;m still and continuously amazed at how much has been done in the community with this library. Thank you all!</p>
<p>A special thanks to Backbone, of course, which is what got me into JavaScript again, and allowed me to build Marionette. Thank you to <a href="http://medienfreunde.com/">MedienFreunde</a> for the amazing logo and website.</p>
<p>And thank you to all of the awesome people building apps with Marionette. Projects like <a href="http://app.halowaypoint.com">Halo Waypoint</a>, <a href="http://www.redbullmusicacademy.com/">Redbull Music Academy</a>, and <a href="http://www.stubhub.com/">StubHub</a> are among the most widely known systems built with Marionette &#8211; then there&#8217;s the three error reporting / analytics tools: <a href="http://airbrake.io/">AirBrake.io</a>, <a href="http://raygun.io/">RayGun.io</a> and <a href="http://crashlytics.com/">CrashLytics</a>. But there are so many more out there, still It&#8217;s been awesome seeing Marionette in all these places, and I&#8217;m looking forward to seeing where it goes from here! :)</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=XC0CqhEo0XM:z9FyNNUfR58:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=XC0CqhEo0XM:z9FyNNUfR58:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=XC0CqhEo0XM:z9FyNNUfR58:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=XC0CqhEo0XM:z9FyNNUfR58:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=XC0CqhEo0XM:z9FyNNUfR58:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=XC0CqhEo0XM:z9FyNNUfR58:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=XC0CqhEo0XM:z9FyNNUfR58:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=XC0CqhEo0XM:z9FyNNUfR58:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/XC0CqhEo0XM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/25/marionettejs-v1-0-now-with-stickers/</feedburner:origLink></item>
		<item>
		<title>Event Aggregator And/Or/vs Mediator: A Tale Of Two Patterns</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/Obcrmwh1OZU/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 15:00:14 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[AntiPatterns]]></category>
		<category><![CDATA[Backbone]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Principles and Patterns]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1075</guid>
		<description>Design patterns often differ only in semantics and intent. That is, the language used to describe the pattern is what sets it apart, more than an implementation of that specific pattern. It often comes down to squares vs rectangles vs&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>Design patterns often differ only in semantics and intent. That is, the language used to describe the pattern is what sets it apart, more than an implementation of that specific pattern. It often comes down to squares vs rectangles vs polygons. You can create the same end result with all three, given the constraints of a square are still met &#8211; or you can use polygons to create an infinitely larger and more complex set of things.</p>
<p>When it comes to the <a href="http://en.wikipedia.org/wiki/Mediator_pattern">Mediator</a> and <a href="http://martinfowler.com/eaaDev/EventAggregator.html">Event Aggregator</a> patterns, there are some times where it may look like the patterns are interchangeable due to implementation similarities. However, the semantics and intent of these patterns are very different. And even if the implementations both use some of the same core constructs, I believe there is a distinct difference between them. I also believe they should not be interchanged or confused in communication because of the differences.</p>
<h2>It&#8217;s All About Logic</h2>
<p>The TL;DR version of this article is this: where does the logic live? An event aggregator has no logic, other than forwarding events from a publisher to a subscriber. A mediator, on the other hand, encapsulates the potentially complex logic of coordinating multiple other objects and/or services, to accomplish a goal. A mediator contains real application / business / workflow / process logic.</p>
<p>This is the line I&#8217;m drawing in the ever-shifting sands of implementation details and fuzzy heuristics.</p>
<h2>Event Aggregator</h2>
<p>The core idea of the <a>Event Aggregator</a>, accoring to Martin Fowler, is to channel multiple event sources through a single object so that other objects needing to subscribe to the events don&#8217;t need to know about every event source.</p>
<h3>Backbone&#8217;s Event Aggregator</h3>
<p>The easiest event aggregator to show is that of <a href="http://backbonejs.org">Backbone.js</a> &#8211; it&#8217;s built in to the <code>Backbone</code> object directly.</p>
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">View1</span> <span class="o">=</span> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span><span class="p">.</span><span class="nx">extend</span><span class="p">({</span>
  <span class="c1">// ...</span>

  <span class="nx">events</span><span class="o">:</span> <span class="p">{</span>
    <span class="s2">"click .foo"</span><span class="o">:</span> <span class="s2">"doIt"</span>
  <span class="p">},</span>

  <span class="nx">doIt</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="c1">// trigger an event through the event aggregator</span>
    <span class="nx">Backbone</span><span class="p">.</span><span class="nx">trigger</span><span class="p">(</span><span class="s2">"some:event"</span><span class="p">);</span>
  <span class="p">}</span>
<span class="p">});</span>

<span class="kd">var</span> <span class="nx">View2</span> <span class="o">=</span> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span><span class="p">.</span><span class="nx">extend</span><span class="p">({</span>
  <span class="c1">// ...</span>

  <span class="nx">initialize</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="c1">// subscribe to the event aggregator's event</span>
    <span class="nx">Backbone</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"some:event"</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">doStuff</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
  <span class="p">},</span>

  <span class="nx">doStuff</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>
    <span class="c1">// ...</span>
  <span class="p">}</span>
<span class="p">})</span>
</pre>
</div>
<p>In this example, the first view is triggering an event when a DOM element is clicked. The event is triggered through Backbone&#8217;s built-in event aggregator &#8211; the <code>Backbone</code> object. Of course, <a href="http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/">it&#8217;s trivial to create your own event aggregator in Backbone</a>, and there are some <a href="http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/">key things that we need to keep in mind when using an event aggregator</a>, to keep our code simple.</p>
<h3>jQuery&#8217;s Event Aggregator</h3>
<p>Did you know that jQuery has a built-in event aggregator? They don&#8217;t call it this, but it&#8217;s in there and it&#8217;s scoped to DOM events. It also happens to look like Backbone&#8217;s event aggregator:</p>
<div class="highlight">
<pre><span class="nx">$</span><span class="p">(</span><span class="s2">"#mainArticle"</span><span class="p">).</span><span class="nx">on</span><span class="p">(</span><span class="s2">"click"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">){</span>

  <span class="c1">// handle the event that any element underneath of our #mainArticle element</span>

<span class="p">});</span>
</pre>
</div>
<p>This code sets up an event handler function that waits for an unknown number of event sources to trigger a &#8220;click&#8221; event, and it allows any number of listeners to attach to the events of those event publishers. jQuery just happens to scope this event aggregator to the DOM.</p>
<h2>Mediator</h2>
<p>A <a href="http://en.wikipedia.org/wiki/Mediator_pattern">Mediator</a> is an object that coordinates interactions (logic and behavior) between multiple objects. It makes decisions on when to call which objects, based on the actions (or in-action) of other objects and input.</p>
<h3>A Mediator For Backbone</h3>
<p>Backbone doesn&#8217;t have the idea of a mediator built in to it like a lot of other MV* frameworks do. But that doesn&#8217;t mean you can&#8217;t write one in 1 line of code:</p>
<p><code>var mediator = {};</code></p>
<p>Yes, of course this is just an object literal in JavaScript. Once again, we&#8217;re talking about semantics here. The purpose of the mediator is to <a href="http://lostechies.com/derickbailey/2012/05/10/modeling-explicit-workflow-with-code-in-javascript-and-backbone-apps/">control the workflow between objects</a> and we really don&#8217;t need anything more than an object literal to do this.</p>
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">orgChart</span> <span class="o">=</span> <span class="p">{</span>

  <span class="nx">addNewEmployee</span><span class="o">:</span> <span class="kd">function</span><span class="p">(){</span>

    <span class="c1">// getEmployeeDetail provides a view that users interact with</span>
    <span class="kd">var</span> <span class="nx">employeeDetail</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getEmployeeDetail</span><span class="p">();</span>

    <span class="c1">// when the employee detail is complete, the mediator (the 'orgchart' object)</span>
    <span class="c1">// decides what should happen next</span>
    <span class="nx">employeeDetail</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"complete"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">employee</span><span class="p">){</span>

      <span class="c1">// set up additional objects that have additional events, which are used</span>
      <span class="c1">// by the mediator to do additional things</span>
      <span class="kd">var</span> <span class="nx">managerSelector</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">selectManager</span><span class="p">(</span><span class="nx">employee</span><span class="p">);</span>
      <span class="nx">managerSelector</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"save"</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">employee</span><span class="p">){</span>
        <span class="nx">employee</span><span class="p">.</span><span class="nx">save</span><span class="p">();</span>
      <span class="p">});</span>

    <span class="p">});</span>
  <span class="p">},</span>

  <span class="c1">// ...</span>
<span class="p">}</span>
</pre>
</div>
<p>This example shows a very basic implementation of a mediator object with Backbone based objects that can trigger and subscribe to events. I&#8217;ve often referred to this type of object as a &#8220;workflow&#8221; object in the past, but the truth is that it is a mediator. It is an object that handles the workflow between many other objects, aggregating the responsibility of that workflow knowledge in to a single object. The result is workflow that is easier to understand and maintain.</p>
<h2>Similarities And Differences</h2>
<p>There are, without a doubt, similarities between the event aggregator and mediator examples that I&#8217;ve shown here. The similarities boil down to two primary items: events and third-party objects. These differences are superficial at best, though. When we dig in to the intent of the pattern and see that the implementations can be dramatically different, the nature of the patterns become more apparent.</p>
<h3>Events</h3>
<p>Both the event aggregator and mediator use events, in the above examples. An event aggregator obviously deals with events &#8211; it&#8217;s in the name after all. The mediator only uses events because it makes life easy when dealing with Backbone, though. There is nothing that says a mediator must be built with events. You can build a mediator with callback methods, by handing the mediator reference to the child object, or by any of a number of other means.</p>
<p>The difference, then, is why these two patterns are both using events. The event aggregator, as a pattern, is designed to deal with events. The mediator, though, only uses them because it&#8217;s convenient.</p>
<h3>Third-Party Objects</h3>
<p>Both the event aggregator and mediator, by design, use a third-party object to facilitate things. The event aggregator itself is a third-party to the event publisher and the event subscriber. It acts as a central hub for events to pass through. The mediator is also a thirdy party to other objects, though. So where is the difference? Why don&#8217;t we call an event aggregator a mediator? The answer largely comes down to where the application logic and workflow is coded.</p>
<p>In the case of an event aggregator, the third party object is there only to facilitate the pass-through of events from an unknown number of sources to an unknown number of handlers. All workflow and business logic that needs to be kicked off is put directly in to the the object that triggers the events and the objects that handle the events.</p>
<p>In the case of the mediator, though, the business logic and workflow is aggregated in to the mediator itself. The mediator decides when an object should have it&#8217;s methods called and attributes updated based on factors that the mediator knows about. It encapsulates the workflow and process, coordinating multiple objects to produce the desired system behaviour. The individual objects involved in this workflow each know how to perform their own task. But it&#8217;s the mediator that tells the objects when to perform the tasks by making decisions at a higher level than the individual objects.</p>
<p>An event aggregator facilitates a &#8220;fire and forget&#8221; model of communication. The object triggering the event doesn&#8217;t care if there are any subscribers. It just fires the event and moves on. A mediator, though, might use events to make decisions, but it is definitely not &#8220;fire and forget&#8221;. A mediator pays attention to a known set of input or activities so that it can facilitate and coordinate additional behavior with a known set of actors (objects).</p>
<h2>Relationships: When To Use Which</h2>
<p>Understanding the similarities and differences between an event aggregator and mediator is important for semantic reasons. It&#8217;s equally as important to understand when to use which pattern, though. The basic semantics and intent of the patterns does inform the question of when, but actual experience in using the patterns will help you understand the more subtle points and nuanced decisions that have to be made.</p>
<h3>Event Aggregator Use</h3>
<p>In general, an event aggregator is uses when you either have too many objects to listen to directly, or you have objects that are unrelated entirely.</p>
<p>When two objects have a direct relationship already &#8211; say, a parent view and child view &#8211; then there might be little benefit in using an event aggregator. Have the child view trigger an event and the parent view can handle the event. This is most commonly seen in Backbone&#8217;s Collection and Model, where all Model events are bubbled up to and through it&#8217;s parent Collection. A Collection often uses model events to modify the state of itself or other models. Handling &#8220;selected&#8221; items in a collection is a good example of this.</p>
<p>jQuery&#8217;s <a href="http://api.jquery.com/on/">on</a> method as an event aggregator is a great example of too many objects to listen to. If you have 10, 20 or 200 DOM elements that can trigger a &#8220;click&#8221; event, it might be a bad idea to set up a listener on all of them individually. This could quickly deteriorate performance of the application and user experience. Instead, using jQuery&#8217;s <code>on</code> method allows us to aggregate all of the events and reduce the overhead of 10, 20, or 200 event handlers down to 1.</p>
<p>Indirect relationships are also a great time to use event aggregators. In Backbone applications, it is very common to have multiple view objects that need to communicate, but <a href="http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/">have no direct relationship</a>. For example, a menu system might have a view that handles the menu item clicks. But we don&#8217;t want the menu to be direcly tied to the content views that show all of the details and information when a menu item is clicked. Having the content and menu coupled together would make the code very difficult to maintain, in the long run. Instead, we can use an event aggregator to trigger &#8220;menu:click:foo&#8221; events, and have a &#8220;foo&#8221; object handle the click event to show it&#8217;s content on the screen.</p>
<h3>Mediator Use</h3>
<p>A mediator is best applied when two or more objects have an indirect working relationship, and business logic or workflow needs to dictate the interactions and coordination of these objects.</p>
<p><a href="http://lostechies.com/derickbailey/2012/05/10/modeling-explicit-workflow-with-code-in-javascript-and-backbone-apps/">A wizard interface is a good example of this</a>, as shown with the &#8220;orgChart&#8221; example, above. There are multiple views that facilitate the entire workflow of the wizard. Rather than tightly coupling the view together by having them reference each other directly, we can decouple them and more explicitly model the workflow between them by introducing a mediator.</p>
<p>The mediator extracts the workflow from the implementation details and creates a more natural abstraction at a higher level, showing us at a much faster glance what that workflow is. We no longer have to dig in to the details of each view in the workflow, to see what the workflow actually is.</p>
<h2>Event Aggregator And Mediator Together</h2>
<p>The crux of the difference between an event aggregator and a mediator, and why these pattern names should not be interchanged with each other, is illustrated best by showing how they can be used together. The menu example for an event aggregator is the perfect place to introduce a mediator as well.</p>
<p>Clicking a menu item may trigger a series of changes throughout an application. Some of these changes will be independent of others, and using an event aggregator for this makes sense. Some of these changes may be internally related to each other, though, and may use a mediator to enact those changes. A mediator, then, could be set up to listen to the event aggregator. It could run it&#8217;s logic and process to facilitate and coordinate many objects that are related to each other, but unrelated to the original event source.</p>
<div class="highlight">
<pre><span class="kd">var</span> <span class="nx">MenuItem</span> <span class="o">=</span> <span class="nx">Backbone</span><span class="p">.</span><span class="nx">View</span><span class="p">.</span><span class="nx">extend</span><span class="p">({</span>

  <span class="nx">events</span><span class="o">:</span> <span class="p">{</span>
    <span class="s2">"click .thatThing"</span><span class="o">:</span> <span class="s2">"clickedIt"</span>
  <span class="p">},</span>

  <span class="nx">clickedIt</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">){</span>
    <span class="nx">e</span><span class="p">.</span><span class="nx">preventDefault</span><span class="p">();</span>

    <span class="c1">// assume this triggers "menu:click:foo"</span>
    <span class="nx">Backbone</span><span class="p">.</span><span class="nx">trigger</span><span class="p">(</span><span class="s2">"menu:click:"</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">model</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">"name"</span><span class="p">));</span>
  <span class="p">}</span>

<span class="p">});</span>

<span class="c1">// ... somewhere else in the app</span>

<span class="kd">var</span> <span class="nx">MyWorkflow</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(){</span>
  <span class="nx">Backbone</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">"menu:click:foo"</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">doStuff</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
<span class="p">};</span>

<span class="nx">MyWorkflow</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">doStuff</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(){</span>
  <span class="c1">// instantiate multiple objects here.</span>
  <span class="c1">// set up event handlers for those objects.</span>
  <span class="c1">// coordinate all of the objects in to a meaninful workflow.</span>
<span class="p">};</span>
</pre>
</div>
<p>In this example, when the <code>MenuItem</code> with the right model is clicked, the &#8220;menu:click:foo&#8221; event will be triggered. An instance of the &#8220;MyWorkflow&#8221; object, assuming one is already instantiated, will handle this specific event and will coordinate all of the objects that it knows about, to create the desired user experience and workflow.</p>
<p>An event aggregator and a mediator have been combined to create a much more meaningful experience in both the code and the application itself. We now have a clean separation between the menu and the workflow through an event aggregator. And we are still keeping the workflow itself clean and maintainable through the use of a mediator.</p>
<h2>Pattern Language: Semantics</h2>
<p>There is one overriding point to make in all of this discussion: semantics. Communicating intent and semantics through the use of named patterns is only viable and only valid when all parties in a communication medium understand the language in the same way.</p>
<p>If I say &#8220;apple&#8221;, what am I talking about? Am I talking about a fruit? Or am I talking about a technology and consumer products company? As <a href="http://lostechies.com/sharoncichelli/">Sharon Cichelli</a> says: &#8220;semantics will continue to be important, until we learn how to communicate in something other than language&#8221;.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=Obcrmwh1OZU:GIg0K2F5_74:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=Obcrmwh1OZU:GIg0K2F5_74:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=Obcrmwh1OZU:GIg0K2F5_74:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=Obcrmwh1OZU:GIg0K2F5_74:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=Obcrmwh1OZU:GIg0K2F5_74:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=Obcrmwh1OZU:GIg0K2F5_74:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=Obcrmwh1OZU:GIg0K2F5_74:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=Obcrmwh1OZU:GIg0K2F5_74:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/Obcrmwh1OZU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/18/event-aggregator-andorvs-mediator-a-tale-of-two-patterns/</feedburner:origLink></item>
		<item>
		<title>Tips On Submitting A Conference Session</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/GremcUZaw7Y/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 15:56:24 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[AntiPatterns]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Retrospectives]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1071</guid>
		<description>In the last 3 or so years, I&amp;#8217;ve had every conference submission I&amp;#8217;ve entered, rejected. Now that doesn&amp;#8217;t mean I haven&amp;#8217;t spoken at any conferences &amp;#8211; I&amp;#8217;ve been invited to a handful and have had a ton of fun at&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>In the last 3 or so years, I&#8217;ve had every conference submission I&#8217;ve entered, rejected. Now that doesn&#8217;t mean I haven&#8217;t spoken at any conferences &#8211; I&#8217;ve been invited to a handful and have had a ton of fun at them. But for every conference that I&#8217;ve submitted a session too, I have not been selected. It&#8217;s not fun being rejected 6+ times in a row. The worst part, though, is not getting any valid feedback on why. I ranted about this for a while on Twitter yesterday, and got some interesting feedback.</p>
<h2>The Worst Part</h2>
<p>The worst parts of the constant rejection include not getting any feedback on why, and the constant growing self doubt. But the absolute worst rejection was from CodeMash last year, where they passed me up in favor of some other guy that wanted to do a Marionette session. I heard reports that it didn&#8217;t go well… and they chose this guy over me, the creator of Marionette. That one still stands out as the most crushing rejection.</p>
<p>But enough self-pitty-crap. You&#8217;re here the find out WHY and how to fix it, right?</p>
<h2>The Submission</h2>
<p>I ended up <a href="https://gist.github.com/derickbailey/5166832">posting one of my recent submissions to a gist</a> so that I could get some actual feedback. This is the basic session submission information that I&#8217;ve been using for a while now. I change it up from here, based on the specific talk that I&#8217;m going to give, but it generally looks like this:</p>
<blockquote>
<p><strong>Scaling JavaScript Apps With Backbone And Marionette</strong></p>
<p>Nearly everyone understands how to build a simple JavaScript application these days. From the classic “Todo” JavaScript app, to simple forms-over-data jQuery apps, we’ve all been around that block a few times. With the recent explosion of JavaScript MV* tools and frameworks, though, many of us find ourselves in over our heads, looking at patterns and practices that work well for small applications and pages but fail when scaling to anything substantial.</p>
<p>In this session, Derick Bailey will give you an introduction and walk through of many of the patterns and practices that your JavaScript applications need to be scalable. You’ll learn why copying Ruby on Rails’ pattern of “Models”, “Views” and “Controllers” folder names is wrong for scaling JavaScript apps, and how to correct that . You’ll learn about the necessity of separating the various concerns of your application. You’ll learn about patterns that aggregate and coordinate functionality from other parts of the system, how and when to properly decouple disparate areas of your application through messaging patterns, and more. And all of this will be illustrated with Backbone, MarionetteJS and additional plugins and patterns that can give you an edge in creating scalable applications in JavaScript.</p>
</blockquote>
<p>I asked people to tear this apart for me, and tell me what I have been doing wrong. I got exactly what I wanted, and I have a lot of great tips to move forward, now. </p>
<h2>The Raw Responses</h2>
<p>There&#8217;s a lot of useful tips in the raw responses, and lessons that can be picked from the responses. Rather than just trying to summarize things, though, I&#8217;m just going to post the responses directly and add my reactions.</p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> I&#8217;ll be honest, it&#8217;s the beard man. They are Jealous of your testosterone.</p>
<p>— Scott Koon (@lazycoder) <a href="https://twitter.com/lazycoder/status/312375144985288704">March 15, 2013</a></p></blockquote>
<p>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script><br />
Ok, Scott&#8217;s probably right. My beard is amazing. But it&#8217;s probably more likely:</p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> Ok, I&#8217;ll be actually honest here. I have no idea WHY code on the client needs to scale past a single user?</p>
<p>— Scott Koon (@lazycoder) <a href="https://twitter.com/lazycoder/status/312375777649885185">March 15, 2013</a></p></blockquote>
<p>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script><br />
Here&#8217;s one of the problems: semantics. &#8220;Scalability&#8221; is an over-used and abused word these days. When I say &#8220;scalability&#8221; in that abstract, I mean scaling to 10&#8242;s of thousands of lines of code, dozens of feature areas, sub-applications and general code size. I&#8217;m not referring to number of users since this all runs on client-side, one-person-at-a-time browsers. </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> True, but you don&#8217;t say that in the abstract. I&#8217;m guessing you mean tons of data on the client w/complex cardinality.</p>
<p>— Scott Koon (@lazycoder) <a href="https://twitter.com/lazycoder/status/312376394334208002">March 15, 2013</a></p></blockquote>
<p>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script><br />
Dually noted, and something I need to clarify in my abstract.</p>
<p> </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> @<a href="https://twitter.com/jbogard">jbogard</a> @<a href="https://twitter.com/robconery">robconery</a> Needs more excitement! Get me excited about something!</p>
<p>— Kelly Sommers (@kellabyte) <a href="https://twitter.com/kellabyte/status/312375796973051904">March 15, 2013</a></p></blockquote>
<p>This is more likely the largest issue, and is the most common thread of feedback that I got. I spent years learning to take the emotion and extraneous fluff out of my written communications because I worked for large corporations where CEO&#8217;s wanted logical justification for me spending $100,000 on servers and software. Hand-waving doesn&#8217;t go over well in that environment, but apparently it&#8217;s what you need in a conference submission.</p>
<p> </p>
<p><a href="https://gist.github.com/derickbailey/5166832#comment-798819">Rob Conery responded</a> to my gist, with this:</p>
<blockquote>
<p>##Taking The Suck Out of Javascript with MarionetteJS</p>
<p>Many have heard of Single Page Applications and, even though most of us in the room might not admit it, have experimented with the idea late at night&#8230; only to face the inevitable self-loathing and vacant, soulless feeling the next day. In this talk Derick Bailey will show you a happier path for building Single Page Applications, using Marionette together with BackboneJS.</p>
<p>Marionette helps to structure your Javascript applications &#8211; doing the things you don&#8217;t want to do (or have tired of doing thousands of times over) &#8211; and it won&#8217;t leave your code feeling bloated and lifeless.</p>
</blockquote>
<p>This sparked a small response line in twitter:</p>
<p><img title="Screen Shot 2013-03-15 at 10.36.05 AM.png" src="http://lostechies.com/derickbailey/files/2013/03/Screen-Shot-2013-03-15-at-10.36.05-AM.png" alt="Screen Shot 2013 03 15 at 10 36 05 AM" width="519" height="559" border="0" /></p>
<p>Even if it bums people out, it&#8217;s a much more exciting and entertaining abstract. I would go to this session.</p>
<p> </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/robconery">robconery</a> @<a href="https://twitter.com/kellabyte">kellabyte</a> @<a href="https://twitter.com/derickbailey">derickbailey</a> just do what jon skeet did in his abstract “I’M JON SKEET. SCIENCE BITCHES!!”</p>
<p>— Jimmy Bogard (@jbogard) <a href="https://twitter.com/jbogard/status/312377924433084416">March 15, 2013</a> </p></blockquote>
<p>hmm… I&#8217;m considering this, though I think Jon Skeet might have problems with me claiming to be him. :D</p>
<p> </p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> @<a href="https://twitter.com/jbogard">jbogard</a> @<a href="https://twitter.com/robconery">robconery</a> the abstract is too long. I liked the direction Rob was heading in the comments</p>
<p>— Chad Myers (@chadmyers) <a href="https://twitter.com/chadmyers/status/312379238605012992">March 15, 2013</a> </p></blockquote>
<p>Also very true. Anyone that has read me blog or articles knows that I have a hard time being concise. I definitely need to work on the length of abstract, which would also help move it toward the goal of more excitement. Less to read means I have to pack more information and punch in to fewer words.</p>
<p> </p>
<p>In a separate email conversation, Steve Smith (<a href="http://twitter.com/ardalis">@ardalis</a>) had this to say:</p>
<blockquote>
<p>Rob’s comment is great. Short, exciting, attention-getting abstracts are the best, but they’re not easy to write. What’s at least as important to those selecting sessions for an event is the speaker themselves. If you’re well-known, especially for the topic, that matters far more than the abstract. It’s also helpful to include your speaking background, so that those who don’t know you at least know you’re not new to speaking. Including ratings can help, too, as in: “Presented a similar talk to 100 developers at XYZ code camp and was rated 9.2 out of 10”</p>
<p>My first pass at abstracts usually look a lot like your initial one, which is kind of like the standard Microsoft product naming convention of describe-what-it-is-in-general-terms. If I’m submitting to something I already know I’m accepted for, I usually won’t spend a lot of time trying to sex it up, either (like, for a user group, for instance). But for something like TechEd or any other larger event where I don’t necessarily already have an “in”, I’ll try to spend more time making the abstracts more exciting, and also demonstrating my past experience.</p>
</blockquote>
<p>There&#8217;s a lot of great summary in here, for sure. I&#8217;m not sure I buy the &#8220;celebrity&#8221; angle at this point, though. In spite of being invited to speak about Marionette (among other things) and in spite of Marionette being the most watched Backbone framework on Github, with my name all over it, people still reject my sessions in favor of other people. </p>
<p>Unless you&#8217;re Jon Skeet, Addy Osmani or Paul Irish, you&#8217;re going to have to beg your way in to most conference submissions. You&#8217;re going to have to pay attention to the detail and make the submission exciting, or you&#8217;ll be passed up in spite of your name being all over the project that they want to hear about.</p>
<p> </p>
<p>Lastly, @kellabyte capped it off with a dose of reality for all of this advice:</p>
<blockquote class="twitter-tweet">
<p>@<a href="https://twitter.com/derickbailey">derickbailey</a> @<a href="https://twitter.com/robconery">robconery</a> @<a href="https://twitter.com/jbogard">jbogard</a> Nothing guarantees anything we say is worth a damn though :P</p>
<p>— Kelly Sommers (@kellabyte) <a href="https://twitter.com/kellabyte/status/312379489105637376">March 15, 2013</a></p></blockquote>
<p> </p>
<p>While this is true, I&#8217;m grateful to have received this feedback! This is infinitely more useful than the generic, patronizing &#8220;we had too many great submissions to choose from&#8221; responses that conference organizers like to send.</p>
<h2>What Other Advice Do You Have?</h2>
<p>I know I have a lot of work ahead of me to improve my submissions, and I&#8217;m still looking for more advice and more feedback. What else would you add to the conversation? What other tips and tricks do you have? </p>
<p>I don&#8217;t want others to have to go through this. Help us all learn from your lessons and patterns in successful session submissions. Post in the comments here, or in a response blog post. Just be sure to share your tips with the world so that others can hopefully avoid the mistakes and learn from the successful lessons.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=GremcUZaw7Y:pqPzL1w0tg8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=GremcUZaw7Y:pqPzL1w0tg8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=GremcUZaw7Y:pqPzL1w0tg8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=GremcUZaw7Y:pqPzL1w0tg8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=GremcUZaw7Y:pqPzL1w0tg8:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=GremcUZaw7Y:pqPzL1w0tg8:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=GremcUZaw7Y:pqPzL1w0tg8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=GremcUZaw7Y:pqPzL1w0tg8:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/GremcUZaw7Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/15/tips-on-submitting-a-conference-session/</feedburner:origLink></item>
		<item>
		<title>On Testing “Trivial Code”</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/FpPXfBCeaIY/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/11/on-testing-trivia-code/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 17:05:06 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[AntiPatterns]]></category>
		<category><![CDATA[Principles and Patterns]]></category>
		<category><![CDATA[Quality]]></category>
		<category><![CDATA[Test Automation]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1063</guid>
		<description>I can&amp;#8217;t resist jumping on the band-wagon and telling people that they&amp;#8217;re wrong, so here goes… :D Mark &amp;#8220;Ploeh&amp;#8221; Seemann wrote a post on testing trivial code. There have been several responses saying he&amp;#8217;s wrong and that you shouldn&amp;#8217;t test&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/03/11/on-testing-trivia-code/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>I can&#8217;t resist jumping on the band-wagon and telling people that they&#8217;re wrong, so here goes… :D</p>
<p>Mark &#8220;Ploeh&#8221; Seemann wrote a post on <a href="http://blog.ploeh.dk/2013/03/08/test-trivial-code/">testing trivial code</a>. There have been several responses saying he&#8217;s wrong and that <a href="http://blog.markrendle.net/2013/03/09/dont-unit-test-trivial-code/">you shouldn&#8217;t test trivial code</a>. Some of the responses have been a little <a href="https://github.com/ploeh/ploeh.github.com/pull/7">less graceful</a> than others (and slightly gross and maybe NSFW &#8211; an orangutan peeing).</p>
<p>Everyone that has responded so far, is wrong in some way. I&#8217;m wrong in some way as well and I&#8217;m sure this is going to turn in to another &#8220;beating the dead horse&#8221; conversation quickly with people pointing fingers and poking eyes. I just want in on the fun while it is here to be had.</p>
<h2>Ploeh Is Right, For The Wrong Reasons</h2>
<p>I think Mark is right in that we should test most of our &#8220;trivial&#8221; code (if not all of it). I think he&#8217;s very very wrong is saying that we should unit test all of it &#8211; especially with the examples that he showed of unit testing a C# auto-property for a date/time field.</p>
<p>Mark is right because this field must add some value to the system. If it doesn&#8217;t add some value, it shouldn&#8217;t be there. If it does add some value, we should guarantee the value that it adds. </p>
<h2>Jimmy Bogard Got It Right</h2>
<p>Jimmy wrote a post that I think was unrelated, but happens to <a href="http://lostechies.com/jimmybogard/2013/03/06/when-should-you-test/">fit perfectly in to the conversation</a>. In that post he says:</p>
<blockquote>
<p>When should you test?</p>
<p>When it provides value.</p>
<p>When is that?</p>
<p>It depends.</p>
</blockquote>
<p>Ultimately, it depends is the only reasonable answer. But let&#8217;s take the example of a date/time auto-property that Mark used in his example, for our purposes and discussion.</p>
<p>The value that a date/time property adds may not be in the business logic that uses it. It may not have anything to do with handling of the date/time in some creative way to make sure other things happen at a certain time. It might be as simple as an invoice date, or perhaps a purchase order # on an invoice. Both of these fields are trivial, but both add value to the idea of an invoice. I wouldn&#8217;t unit test these fields if they are only used for display purposes, though. Instead, I would focus the test on the place that the field provides value &#8211; the end to end solution.</p>
<h2>Mark Rendle Got Part Of It Right, Too</h2>
<p>I think <a href="http://blog.markrendle.net/2013/03/09/dont-unit-test-trivial-code/">Mark Rendle</a> got some of it right in his response, too. He talks about the idea of validation code in the UI to ensure a date can&#8217;t be set in the past, if that is what the business needs are.</p>
<p>This leads to the real point in adding value in tests.</p>
<h2>Functional Tests, Not Unit Tests</h2>
<p>The value that trivial fields used for display purposes adds, is found in the display of the information. In this case the use of an Invoice Date and Purchase Order Number on the invoice that is sent to the person that needs to pay it  provides value to both the person sending the invoice and the person receiving the invoice &#8211; so test that. Test the display of the information because that&#8217;s where the value is found. Write a functional test that runs your invoice generating process and use a simple UI test to ensure the date shows up. This is where a test provides value for trivial code in this case &#8211; functional tests, not unit tests.</p>
<p>A unit test around a C# auto-property is a bad idea because it only tests the compiler and runtime as others have pointed out. But a functional test that proves &#8220;When I supply a Purchase Order Number, Then the invoice should display the Purchase Order Number&#8221; is a valuable, functional, end to end test. After all, If I were a customer of a company and I sent them a PO# for an invoice, I would want that PO# to show up on my invoice. If it didn&#8217;t show up, I&#8217;d be a little &#8220;<a href="http://hadonejob.com/">YOU ONLY HAD ONE JOB TO DO!</a>&#8221; upset. If I send you a PO# because I need it on my invoice, you better send the invoice back with the PO# or you&#8217;re not getting paid &#8211; at least, you are decreasing the chances of getting paid on time.</p>
<h2>Value In Trivial Code</h2>
<p>There&#8217;s no value in testing trivial code? My &#8220;BS&#8221; alarms are ringing. You want to write unit tests for auto-properties in C#? My &#8220;BS&#8221; alarms are still ringing loud and clear!</p>
<p>My example of using a functional test to prove the value of a PO# is only an example, and not meant to be the ultimate answer or solution. You need to take the time to understand where the value for your trivial code really is. Once you do that, you&#8217;ll understand how to properly scope your tests to prove the value of that trivial code. </p>
<p>If you can articulate the value of that auto-property when you&#8217;re talking to a coworker, you can write a correctly scoped test to prove the value. If you can&#8217;t provide a description of the value of that trivial code, though… it probably doesn&#8217;t need to be there.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=FpPXfBCeaIY:NIBXz6UW1sA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=FpPXfBCeaIY:NIBXz6UW1sA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=FpPXfBCeaIY:NIBXz6UW1sA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=FpPXfBCeaIY:NIBXz6UW1sA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=FpPXfBCeaIY:NIBXz6UW1sA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=FpPXfBCeaIY:NIBXz6UW1sA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=FpPXfBCeaIY:NIBXz6UW1sA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=FpPXfBCeaIY:NIBXz6UW1sA:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/FpPXfBCeaIY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/11/on-testing-trivia-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/11/on-testing-trivia-code/</feedburner:origLink></item>
		<item>
		<title>Method Rewriting: Running With A Lit Stick Of Dynamite</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/EV9JVbUCLJc/</link>
		<comments>http://lostechies.com/derickbailey/2013/03/08/method-rewriting-running-with-a-lit-stick-of-dynamite/#comments</comments>
		<pubDate>Fri, 08 Mar 2013 17:27:19 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[AntiPatterns]]></category>
		<category><![CDATA[Backbone]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Principles and Patterns]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1061</guid>
		<description>I had a problem I wanted to solve. I thought to myself, &amp;#8220;I know! I&amp;#8217;ll use function rewriting!&amp;#8221; and it was good… I solved the problem. But I also introduced some other problems regarding method references and event handlers.  Method&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/03/08/method-rewriting-running-with-a-lit-stick-of-dynamite/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>I had a problem I wanted to solve. I thought to myself, &#8220;I know! I&#8217;ll use function rewriting!&#8221; and it was good… I solved the problem. But I also introduced some other problems regarding method references and event handlers. </p>
<h2>Method Rewriting</h2>
<p>If you&#8217;re not familiar with method rewriting in JavaScript, it&#8217;s basically just replacing a method at runtime, from within the method itself.</p>
<p><script src="https://gist.github.com/5118183.js?file=1.js"></script><noscript>
<pre><code class="language-javascript javascript">var myObj = {
 
  foo: function(){
    console.log(&quot;bar&quot;);
    
    this.foo = function(){
      console.log(&quot;quux&quot;);
    }
    
  }
 
};

myObj.foo(); // =&gt; &quot;bar&quot;
myObj.foo(); // =&gt; &quot;quux&quot;
myObj.foo(); // =&gt; &quot;quux&quot;
// ...</code></pre>
<p></noscript></p>
<p>In this example, the &#8220;foo&#8221; method contains code to replace the &#8220;foo&#8221; method with a new method implementation. When the &#8220;foo&#8221; method is run the first time, it outputs &#8220;bar&#8221;. Then it replaces the &#8220;foo&#8221; method with the new implementation. Subsequent execution of this method will output &#8220;quux&#8221; instead of &#8220;bar&#8221; because the method has been rewritten.</p>
<h2>And BOOM Goes The Dynamite</h2>
<p>The problem I ran into has to do with the way we set up event handlers in JavaScript, by passing function references around. Consider the following Backbone.View implementation:</p>
<p><script src="https://gist.github.com/5118183.js?file=2.js"></script><noscript>
<pre><code class="language-javascript javascript">var MyView = Backbone.View.extend({
  
  initialize: function(){
    this.model.on(&quot;change&quot;, this.render, this);
  }
  
  doSomeExtraWork: function(){
    console.log(&quot;extra work&quot;);
  },
  
  render: function(){
    this.doSomeExtraWork();
    this.$el.html(&quot;... rendered HTML stuff goes here ...&quot;);
    
    this.render = function(){
      this.$el.html(&quot;... rendered HTML stuff goes here ...&quot;);      
    }
  }
  
});

var model = new Backbone.Model();
var view = new MyView({model: model});

view.render(); // =&gt; console.log of &quot;extra work&quot;
view.render(); // =&gt; no console.log! yay!

model.set(&quot;foo&quot;, &quot;bar&quot;); // =&gt; console.log of &quot;extra work&quot;. BOOO!</code></pre>
<p></noscript></p>
<p>When the view is instantiated, a &#8220;change&#8221; event from the view&#8217;s model is handled. When the model changes, it calls the &#8220;render&#8221; function. This ensures the view is always up to date with the latest data from the model. It&#8217;s not a very good solution from a performance perspective, but it solves the general problem.</p>
<p>Now let&#8217;s introduce a more complicated scenario where the first time the view renders, it should do a little bit of extra work. Subsequent execution of the render method should not do that extra work. I&#8217;m not going to get in to detail about what the extra work might be in a real application, but I can illustrate the point using some simple console.log calls. </p>
<p>When you run the above code, the first call to the render method logs the &#8220;extra work&#8221; message. Calling the render method a second time, directly, does not produce this message. That&#8217;s good. It means our function re-writing worked. However, changing any of the data on the model will produce the &#8220;extra work&#8221; message, which is not what we want.  Worse still, it will replace the &#8220;render&#8221; method on the view instance again, and again, and again, every time the change event fires.</p>
<h2>Lighting The Dynamite</h2>
<p>The problem is the way we hand off a reference to the function for the event handler. When we call `this.model.on(&#8220;change&#8221;, this.render, this);`, we are handing a method pointer to the &#8220;on&#8221; function &#8211;  a callback that points directly to the current implementation of the &#8220;render&#8221; function. This is not a reference that gets evaluated every time the change method fires. It is evaluated immediately when the event handler is set up, and a direct reference to the render function itself (not the object that holds on to the render function) is passed through as the event handler.</p>
<p>When the render function is called later on, the render function itself replaces the view&#8217;s &#8220;render&#8221; function with a new function. It re-writes itself… except this is a bit of a misnomer. The function it not actually re-writing itself. What it is doing, really, is replacing the view&#8217;s reference to itself with a reference to another function. It&#8217;s the equivalent of this:</p>
<p><script src="https://gist.github.com/5118183.js?file=3.js"></script><noscript>
<pre><code class="language-javascript javascript">// set up the initial object and method
var myView = {
  render: function(){ ... }
};

// replace the render method
myView.render = function(){
  // ...
};</code></pre>
<p></noscript></p>
<p>In this code, it is very clear that the &#8220;render&#8221; method is being replaced. The original function is not being &#8220;re-written&#8221;, but only replaced. Method re-writing does exactly this, but does it from within the function that is being replaced. </p>
<p>Now, getting back to the event handler… when the &#8220;render&#8221; function replaces itself, it only replaces the function on the view instance. It doesn&#8217;t have a reference to the &#8220;on&#8221; method and it doesn&#8217;t know how to replace that event handler with the new function reference. Therefore, the &#8220;on&#8221; event handler still references the original render function, even after the render function has replaced itself on the view.</p>
<p>The result is that the &#8220;change&#8221; event fired from the model will cause the original render function to be executed. Since the original render function contains the method re-writing code, it will replace the view&#8217;s render method again. Every time the &#8220;change&#8221; event fires from the model, this will happen. If the &#8220;change&#8221; event fires 3 times, the &#8220;render&#8221; function on the view will be replaced 3 times.</p>
<h2>Powerful But Dangerous</h2>
<p>Lesson learned: method rewriting is like running with a lit stick of dynamite. It&#8217;s a powerful tool that serves a purpose &#8211; but the scope and references to the functions that are being re-written need to be controlled very tightly, or it will blow up in your face.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=EV9JVbUCLJc:UefFZtF1ojQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=EV9JVbUCLJc:UefFZtF1ojQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=EV9JVbUCLJc:UefFZtF1ojQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=EV9JVbUCLJc:UefFZtF1ojQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=EV9JVbUCLJc:UefFZtF1ojQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=EV9JVbUCLJc:UefFZtF1ojQ:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=EV9JVbUCLJc:UefFZtF1ojQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=EV9JVbUCLJc:UefFZtF1ojQ:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/EV9JVbUCLJc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/03/08/method-rewriting-running-with-a-lit-stick-of-dynamite/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/03/08/method-rewriting-running-with-a-lit-stick-of-dynamite/</feedburner:origLink></item>
		<item>
		<title>Some Notes On Screencasting</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/uPFcpX6r3Q4/</link>
		<comments>http://lostechies.com/derickbailey/2013/02/19/some-notes-on-screencasting/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 22:55:24 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[Quality]]></category>
		<category><![CDATA[Screencast]]></category>
		<category><![CDATA[Tools and Vendors]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1055</guid>
		<description>I put together some notes for my team, on building some screencasts. I thought they came out fairly well, so I wanted to share with the rest of the world.  Note that these are my opinions based on the work&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/02/19/some-notes-on-screencasting/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>I put together some notes for my team, on building some screencasts. I thought they came out fairly well, so I wanted to share with the rest of the world.  Note that these are my opinions based on the work that I&#8217;ve done with <a href="http://www.watchmecode.net/">WatchMeCode</a>, <a href="http://pragprog.com/screencasts/v-dback/hands-on-backbone-js">PragProg</a>, <a href="http://tekpub.com/">Tekpub</a> and now with <a href="http://www.kendoui.com/">Kendo UI</a>. I know there are 1,000 ways to do any / all of this, and I would love to hear your thoughts on what you do and how you get things done as well. I&#8217;m always looking for ways to improve what I do.</p>
<h2>Getting Started</h2>
<p>Read Rob Conery&#8217;s series on screencasting. He was kind enough to blog everything that I wouldn&#8217;t have been able to say as well as he does. :)</p>
<p><a href="http://wekeroad.com/2012/08/22/screencasting-like-a-pro-beginning-middle-end">http://wekeroad.com/2012/08/22/screencasting-like-a-pro-beginning-middle-end</a><br /><a href="http://wekeroad.com/2012/08/24/screencasting-like-a-pro-the-script">http://wekeroad.com/2012/08/24/screencasting-like-a-pro-the-script</a><br /><a href="http://wekeroad.com/2012/08/31/screencasting-like-a-pro-the-demos">http://wekeroad.com/2012/08/31/screencasting-like-a-pro-the-demos</a></p>
<p>Also read Scott Burtton&#8217;s article on audio compression. Note that this is not file compression… this is audio compression, as in sound engineering.</p>
<p><a href="https://gist.github.com/scottburton11/3222152">https://gist.github.com/scottburton11/3222152</a></p>
<p><strong>Equipment / software:</strong></p>
<p>You need a minimum amount of hardware and software for building screencasts. This list should be fairly obvious:</p>
<ul>
<li>A computer (duh?)</li>
<li>A high quality microphone</li>
<li>Screen/video recording / editing software</li>
<li>Audio recording / editing software</li>
</ul>
<div>
<p><strong>Microphone:</strong></p>
<p>Don&#8217;t use your laptop&#8217;s built in microphone. Don&#8217;t use a skype/g+ hangout/IM quality headset from BestBuy. These microphones are terrible. Buy something of high quality. There are high quality headsets that can be purchased, but it would be best to buy a microphone that is built for recording / broadcasting human voice.</p>
<p>I recommend one of these two:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/B000JM46FY/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B000JM46FY&amp;linkCode=as2&amp;tag=derickbailey-20">Rode Podcaster</a> (what I have)</li>
<li><a href="http://www.amazon.com/gp/product/B002VA464S/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B002VA464S&amp;linkCode=as2&amp;tag=derickbailey-20">Blue Yeti</a></li>
</ul>
<p>You can get others, of course. These are the industry standards for podcasting / screencasting, though. They are broadcast quality, USB powered Microphones. The Blue Yeti is the cheaper of the two, but the Rode Podcaster is the more professional one.</p>
</div>
<h2>Notes On Recording</h2>
<p>Things to keep in mind when recording the audio and video</p>
<p><strong>For recording the video:</strong></p>
<ul>
<li>Close all programs that are not part of the recording / coding / screencasting process &#8211; especially email and IM apps</li>
<li>Record the entire desktop, not just part of it</li>
<li>Record at your normal screen resolution. Don&#8217;t change the monitor resolution or anything else, to record.</li>
<li>Re-size all windows that you are going to record, down to 1280&#215;720 (720p) resolution</li>
<li>Do not record computer audio</li>
<li>Do not record any audio while recording your screen (the exception to this is if you need to record yourself talking to yourself, so that you can take notes for the real audio recording)</li>
</ul>
<div>
<p><strong>Movement In Video:</strong></p>
<p>Limit the amount of on-screen movement while recording. Don&#8217;t jump back and forth between windows and tabs a lot. Don&#8217;t scroll excessively.</p>
<p>You can, of course, move things around as much as you need when doing your rough recordings. But the end result should be edited so that these extra animations, cmd-tab (alt-tab) screen-switching transitions, and other movement are gone from the final video.</p>
<p>Move your mouse as little as possible. Move it slowly and deliberately so that a person watching can easily track it with their eyes.</p>
<p>Keep this kind of motion limited so the user can focus on the content, not the movement of the screen.</p>
<p><strong>Post-Recording Slides And Animation:</strong></p>
<p>Any time your audio script comes to a point where you are pausing the video to discuss or describe something, you will want to have a slide, an arrow, or some other highlight to point out what you are talking about.</p>
<p>Slides are good for tangential subject matters &#8211; things that people should be aware of, but are not directly covered by the video content. Plan for a few slides, but keep them limited.</p>
<p>Highlights, arrows, word overlays on the video, etc, are good for pointing out the content that you are describing. Plan for a few highlights to illustrate what you&#8217;re talking about, but keep them limited to what&#8217;s important.</p>
<p><strong>Rendering Video:</strong></p>
<p>The final video output should be 1280&#215;720 (720p HD) resolution. I prefer to export MP4 (mpeg layer 4) files as .m4v. This works pretty much everywhere &#8211; iPad, iPhone (though I wouldn&#8217;t recommend that), Windows, Mac, etc.</p>
</div>
<p><strong>For recording the audio:</strong></p>
<ul>
<li>Turn off your phone. Srsly &#8211; I&#8217;ve seen screencasts where people say &#8220;hold on…&#8221; and check txt messages. WAT</li>
<li>Wear a headset if you need to hear the computer&#8217;s audio while recording the audio</li>
<li>Record your voice-over separately from the screen recording</li>
<li>Edit the audio to remove clicks, pops, breathing and other noises</li>
<li>Use a small to moderate amount of audio compression, to keep the audio levels closer to even (see the above link to Scott Burton&#8217;s article on audio compression)</li>
<li>Export the audio at the highest possible quality, using a lossless audio format. Do not export as MP3 or any other file format that would reduce the quality of audio</li>
</ul>
<p>When recording audio, be aware of background noise. A broadcast quality mic will pick up everything. If your office has wood / tile floors, like mine, you probably don&#8217;t want to record in that room because of echo. Find a room with no bare walls, with as few hard surfaces as possible, and with as much &#8220;soft&#8221; stuff to absorb sound, as possible.</p>
<p>I have a small set up in my closet for recording audio, with a mic stand and a portable sound booth. I don&#8217;t expect everyone to have this kind of set up, but using a closet full of clothing will reduce the background noise and create a &#8220;dead room&#8221; effect, where your voice is more natural.</p>
<h2>On a Mac</h2>
<p>I work on a Mac these days, so I have more specific info about this than I do windows.</p>
<ul>
<li>Do not record video on a Retina display</li>
<li>Use <a href="http://www.telestream.net/screenflow/overview.htm">Screenflow</a> to record and edit video</li>
<li>Use <a href="http://www.apple.com/ilife/garageband/">GarageBand</a> to record and edit audio</li>
<li>Splice the audio together with the video, inside of ScreenFlow, after editing the audio separately</li>
<li>To resize your apps to the appropriate size, use a tool like <a href="http://www.irradiatedsoftware.com/sizeup/">SizeUp</a> or applescript <a href="http://lostechies.com/derickbailey/2012/09/08/screencasting-tip-resize-your-app-to-720p-1280x720-in-osx/">like I talked about in another post</a>.</li>
</ul>
<div>You can also use Screeny if you need to save money. If you&#8217;re dirt-cheap/poor (how did you get a mac?) then you can use Quicktime and iMovie, but this is awful and painful.</div>
<div> </div>
<div>For advanced animations and awesome stuff, use <a href="http://www.apple.com/finalcutpro/motion/">Motion 5</a>. </div>
<p><strong>Screenflow settings:</strong></p>
<ul>
<li>Go to &#8220;Preferences&#8221;, &#8220;Advanced&#8221;, and set &#8220;Screen Recording Preferences&#8221; from &#8220;Adaptive&#8221; to &#8220;Lossless&#8221;</li>
<li>Go to &#8220;Preferences&#8221;, &#8220;Advanced&#8221;, and set &#8220;Video Magnification&#8221; to &#8220;Smooth&#8221;</li>
<li>Go to &#8220;Preferences&#8221;, &#8220;Timeline&#8221;, and set the default transition to &#8220;Cross Dissolve&#8221;</li>
</ul>
<h2>On Windows</h2>
<p>Use Camtasia … is there anything else? Not sure about anything else here&#8230; suggestions? What is the Garage Band equivalent on Windows?</p>
<h2>The Video And Audio Script</h2>
<p>Like most things in software development, iteration is the key to success. Learn to iterate your script for both audio and video. This usually means writing one of them first, while thinking about the other. Then writing the other while editing the first to adjust for the things you forgot about.</p>
<p>Organize your scripts as if you were writing blog posts &#8211; short sections with a beginning, middle, and end in each section. Be sure the entire episode also has a beginning, middle and end, as well. </p>
<p>When writing the audio script details, write as if you are speaking &#8211; because you are. Don&#8217;t write for written publications. Write for a an audience that is listening to you do a presentation at a user group. Write in your speaking voice.</p>
<p>You need to be able to record the audio and video in short bursts &#8211; 1 to 2 minutes, maybe 3 to 5 minutes at most. This is critical because you will make mistakes, and you will have to re-record parts and you want to minimize the amount of audio and video that you have to re-record. Building your audio and video script in small, distinct segments will help facilitate this.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=uPFcpX6r3Q4:i6HjXvl97LE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=uPFcpX6r3Q4:i6HjXvl97LE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=uPFcpX6r3Q4:i6HjXvl97LE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=uPFcpX6r3Q4:i6HjXvl97LE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=uPFcpX6r3Q4:i6HjXvl97LE:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=uPFcpX6r3Q4:i6HjXvl97LE:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=uPFcpX6r3Q4:i6HjXvl97LE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=uPFcpX6r3Q4:i6HjXvl97LE:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/uPFcpX6r3Q4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/02/19/some-notes-on-screencasting/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/02/19/some-notes-on-screencasting/</feedburner:origLink></item>
		<item>
		<title>Building Sample Apps in Ruby, NodeJS and PHP</title>
		<link>http://feedproxy.google.com/~r/DerickBailey/~3/V3emvU7gAds/</link>
		<comments>http://lostechies.com/derickbailey/2013/02/12/building-sample-apps-in-ruby-nodejs-and-php/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 20:41:02 +0000</pubDate>
		<dc:creator>Derick Bailey</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://lostechies.com/derickbailey/?p=1053</guid>
		<description>In the last three years I&amp;#8217;ve gone from full time .NET development to full time Ruby on Rails and then full time JavaScript. It&amp;#8217;s been an awesome ride, so far, but it&amp;#8217;s not done yet. I started digging in to&amp;#160;&amp;#8230; &lt;a href="http://lostechies.com/derickbailey/2013/02/12/building-sample-apps-in-ruby-nodejs-and-php/"&gt;Continue&amp;#160;reading&amp;#160;&lt;span class="meta-nav"&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</description>
			<content:encoded><![CDATA[<p>In the last three years I&#8217;ve gone from full time .NET development to full time Ruby on Rails and then full time JavaScript. It&#8217;s been an awesome ride, so far, but it&#8217;s not done yet. I started digging in to PHP recently, and while I&#8217;m not going to be doing full time work with it I am certainly adding it to my list languages and runtimes that I enjoy using. </p>
<p>I know PHP is not the sexiest language in the web world right now, but it has a few things going for it: maturity in the language and frameworks for it, the amazingly friendly community of developers, and how quickly I can get a simple web server up and running.</p>
<p>To illustrate that last point, here&#8217;s a quick comparison of what it takes to get sample web app up and running with my three favorite languages / runtimes right now.</p>
<h2>Ruby / Sinatra</h2>
<p>The fastest way I know to get a Ruby web app up and running is to use Sinatra. I love Sinatra for it&#8217;s simplicity and flexibility. I have a handful of projects and websites built in it. But it takes a bit to get up and running. I have to install the Sinatra gem and everything else associated with it, then configure an app.rb file with all the right routes and other configuration options to serve up the project files.</p>
<p>Sinatra is my primary choice when building Ruby apps. It&#8217;s great for sharing with the Ruby community because everyone understands it. It&#8217;s also cross-platform so anyone on Windows, Linux or Mac can run it. But it is no longer my primary choice for cross-platform demos and sample apps.</p>
<p>I don&#8217;t use Rails unless I know I need to build a full stack, server-side MVC app w/ all the logic and complexity that comes along with Rails. This is not a knock against Rails. It&#8217;s just &#8220;the simplest thing that could work&#8221; philosophy, and getting things done.</p>
<h2>NodeJS</h2>
<p>Node is about the same amount of work to get up and running for a simple demo app. I have to install the Express package through npm and then configure an app.js file to server things correctly. This takes about the same amount of work as Ruby and Sinatra. </p>
<p>There are 3 distinct advantages that I see in Node/Express over, though:</p>
<ul>
<li>Jade as default HTML templates</li>
<li>Easier to run cross-platform</li>
<li>NPM eats RubyGems lunch</li>
</ul>
<p>With Sinatra, I have to go through extra steps to install and configure HAML as the template engine. It&#8217;s worth the extra 2 or 3 things to do, and I always do it. But with Express, Jade is the default template engine. Jade is HAML++ in JavaScript and I love it more than HAML for it&#8217;s even further reduction of noise in HTML tag attributes, etc.</p>
<p>NodeJS is far easier to run cross-platform. Installing and configuring Ruby on a Windows machine is dead-simple. On a Mac? It takes me an hour+ every time I help someone. The community is trying to fix this, but hasn&#8217;t yet. I don&#8217;t know about Linux, but I&#8217;m getting it&#8217;s easier on there than on a Mac. NodeJS, on the other hand, is just easier to install and use everywhere. I can share a NodeJS app with any developer on any platform, and be confident that someone who has never installed or used NodeJS will be able to get it up and running in less than 10 minutes.</p>
<p>NPM is also eating RubyGems lunch right now, for simplicity and feature set, because NPM includes what Bundler does for RubyGems. It really comes down to that. I hate having to &#8220;gem install bundler&#8221; and then &#8220;bundle install&#8221; separately. That&#8217;s stupid. RubyGems should include Bundler in it the way NPM does.</p>
<p>For these three reasons, Node/Express have become my default stack for sharing code with the world. But Node/Express still require more work than PHP, to get a sample web server up and running.</p>
<h2>PHP</h2>
<p>What does it take to get a PHP web server running, so I can begin hacking on a sample app?</p>
<blockquote>
<p>php -S localhost:5000</p>
</blockquote>
<p>Done. </p>
<p>No package manager config files to build. No packages to install. No need to configure a web server file with code. I just type that one liner and I&#8217;m good to go. I can edit and display any .php file or .html file that I want, without any other infrastructure work.</p>
<p>The good news is that I can also get something very similar to Ruby/Sinatra or NodeJS/Express with the PHP Slim framework. It&#8217;s the PHP counterpart of Sinatra and Express &#8211; but it&#8217;s optional. I don&#8217;t have to use this to get a basic PHP project up and running.</p>
<p>The downside to PHP is that it took me a few days to get it installed and configured on my Mac. OSX comes with a poor version of PHP built in, so I had to install the latest. After many different attempts from many different sources of advice, I finally got it installed through Homebrew. Then I had to figure out why the new version wasn&#8217;t the default version. Moving beyond that, I had to figure out that &#8220;SQLite&#8221; and &#8220;SQLite3&#8243; are considered separate, unrelated things instead of just versions of SQLite.</p>
<p>Once I got past those hurdles, though, I found myself quite productive with PHP, quickly. The ability to stand up a sample project in one line of terminal commands is quite appealing. I don&#8217;t know that PHP will become a regular thing for sharing code, though. I&#8217;ll certainly use it when I want to share with the PHP community, or when I need to get a web server up and running in no time flat to server a simple HTML page, though.</p>
<p>If you haven&#8217;t looked at PHP, or it has been a long time (it has been near 13 years since I used it last), I&#8217;d recommend checking it out again. If nothing else, it will server as a quick way to get a simple web server off the ground, to start demoing some HTML and JavaScript.</p>
<h2>What&#8217;s Next?</h2>
<p>I probably need to learn Python for my next web server language. I keep hearing good things about it from a language purity perspective. But that will have to wait until I see another opportunity to learn something new, again.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DerickBailey?a=V3emvU7gAds:SyMxnMy13KI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=V3emvU7gAds:SyMxnMy13KI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=V3emvU7gAds:SyMxnMy13KI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DerickBailey?i=V3emvU7gAds:SyMxnMy13KI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=V3emvU7gAds:SyMxnMy13KI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=V3emvU7gAds:SyMxnMy13KI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=V3emvU7gAds:SyMxnMy13KI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DerickBailey?a=V3emvU7gAds:SyMxnMy13KI:bcOpcFrp8Mo"><img src="http://feeds.feedburner.com/~ff/DerickBailey?d=bcOpcFrp8Mo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DerickBailey/~4/V3emvU7gAds" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/derickbailey/2013/02/12/building-sample-apps-in-ruby-nodejs-and-php/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		<feedburner:origLink>http://lostechies.com/derickbailey/2013/02/12/building-sample-apps-in-ruby-nodejs-and-php/</feedburner:origLink></item>
	</channel>
</rss>
