<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>benlakey.com</title>
	<atom:link href="http://benlakey.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://benlakey.com</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Mon, 20 Feb 2012 07:07:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Performance on-demand; Giving your ops team runtime flexibility</title>
		<link>http://benlakey.com/2012/02/20/performance-on-demand-giving-your-ops-team-runtime-flexibility/</link>
		<comments>http://benlakey.com/2012/02/20/performance-on-demand-giving-your-ops-team-runtime-flexibility/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 07:02:12 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=733</guid>
		<description><![CDATA[Performance On Demand Pretend you are in an operations position, in which your job is to maintain the infrastructure that routes traffic and the servers that serve requests. Wouldn&#8217;t it then be nice, if you suddenly had a surge in traffic or a drop in available server hardware (be it expected or unexpected), you could [...]]]></description>
			<content:encoded><![CDATA[<h3><strong>Performance On Demand</strong></h3>
<p>Pretend you are in an operations position, in which your job is to maintain the infrastructure that routes traffic and the servers that serve requests. Wouldn&#8217;t it then be nice, if you suddenly had a surge in traffic or a drop in available server hardware (be it expected or unexpected), you could alter the performance characteristics of your web applications?</p>
<p>This is a problem we&#8217;ve been tackling with our new set of web apps, and we think we&#8217;ve got a pretty good solution in place.</p>
<h3><strong>Operations Administration Panel for Runtime Configuration</strong></h3>
<p>For starters, we&#8217;ve created an administration web application for our operations folks, whose primary purpose is that of runtime configuration. Operations can control various aspects of our systems from this application, including:</p>
<ul>
<li>Logging levels</li>
<li>Caching TTLs</li>
<li>Database masters/slaves and replication strategies</li>
<li>Application settings</li>
<li>Network locations for editorial assets</li>
<li>Logical service bus participants</li>
<li>Etc.</li>
</ul>
<p>When any of these settings are updated, we send a message on the service bus informing subscribers of changes in the settings they care about. Let&#8217;s analyze the one we made reference to above, which will provide ops with a way to dial in performance on demand.</p>
<h3><strong>Output Caching</strong></h3>
<p>In the administration panel, we&#8217;ve provided a settings page where the output caching TTL and data caching TTL can be set for a given application. When this setting is updated, we publish a message on the service bus, which our front end rendering ASP.NET MVC application can subscribe to.</p>
<p>Creating a handler in the rendering application then is pretty easy. We listen for the settings type that corresponds to caching:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> CacheSettingsUpdater <span style="color: #008000;">:</span> SettingsChangedHandler<span style="color: #008000;">&lt;</span>CacheSettingsData<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">bool</span> ShouldHandle<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> id<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Equals</span><span style="color: #008000;">&#40;</span>
                id,
                CacheSettingsData<span style="color: #008000;">.</span><span style="color: #0000FF;">StorageId</span>,
                StringComparison<span style="color: #008000;">.</span><span style="color: #0000FF;">OrdinalIgnoreCase</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> Update<span style="color: #008000;">&#40;</span>CacheSettingsData settingsData<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            CacheSettings<span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateSettings</span><span style="color: #008000;">&#40;</span>settingsData<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p>As you can see, the handler can then inform a settings class by calling its &#8220;UpdateSettings&#8221; method, who keeps a reference to the latest data.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> CacheSettings
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> CacheSettingsData Data <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> CacheSettingsData<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">int</span> OutputCacheDurationSeconds
        <span style="color: #008000;">&#123;</span>
            get
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span>
                    Data<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentAppCacheParameters</span>
                        <span style="color: #008000;">.</span><span style="color: #0000FF;">OutputCacheDurationSeconds</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> UpdateSettings<span style="color: #008000;">&#40;</span>CacheSettingsData data<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            Data <span style="color: #008000;">=</span> data<span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<h3><strong>Leveraging it with OutputCacheAttribute</strong></h3>
<p>Now, in ASP.NET MVC, there is an action filter for output caching: <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.outputcacheattribute.aspx">OutputCacheAttribute</a>. This attribute can be applied at the controller level, or at the individual action level. When an action is run the first time, the framework will cache the result, such that the next request won&#8217;t require processing again, and will be delivered from cache. The cached item will be delivered from cache until the TTL/Duration expires. The effect of this is that your application won&#8217;t be processing for every request, and will be able to therefor serve more requests.</p>
<p>The issue with connecting up our runtime configuration class from above (CacheSettings) to the OutputCacheAttribute, is that the settings for a filter can only be specified by constants, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #008000;">&#91;</span>OutputCache<span style="color: #008000;">&#40;</span>Duration <span style="color: #008000;">=</span> <span style="color: #FF0000;">10</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Index<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span></pre></div></div>

<p>&nbsp;</p>
<p>So, we need to instead create our own action filter, which inherits from OutputCacheAttribute, so we can control where it gets its values from. I&#8217;ve simplified this for brevity to just illustrate the Duration extensibility point.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> ConfiguredOutputCacheAttribute <span style="color: #008000;">:</span> OutputCacheAttribute
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #008000;">new</span> <span style="color: #6666cc; font-weight: bold;">int</span> Duration
        <span style="color: #008000;">&#123;</span>
            get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Duration</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
            set
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">throw</span> <span style="color: #008000;">new</span> NotSupportedException<span style="color: #008000;">&#40;</span>
                    <span style="color: #666666;">&quot;Duration cannot be set directly. &quot;</span> <span style="color: #008000;">+</span>
                    <span style="color: #666666;">&quot;Set from runtime config.&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> ConfiguredOutputCacheAttribute<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Duration</span> <span style="color: #008000;">=</span> CacheSettings<span style="color: #008000;">.</span><span style="color: #0000FF;">OutputCacheDurationSeconds</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnActionExecuting<span style="color: #008000;">&#40;</span>
            ActionExecutingContext filterContext<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Duration</span> <span style="color: #008000;">=</span> CacheSettings<span style="color: #008000;">.</span><span style="color: #0000FF;">OutputCacheDurationSeconds</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OnActionExecuting</span><span style="color: #008000;">&#40;</span>filterContext<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p>As you can see, when we hit OnActionExecuting, we check the CacheSettings class for the current output cache duration, and set it on the base OutputCacheAttribute class we inherited from. The effect of this, is that during day to day traffic, operations can control the cache TTL.</p>
<p>Then we just apply it where we want to cache:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #008000;">&#91;</span>ConfiguredOutputCache<span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Index<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span></pre></div></div>

<p>&nbsp;</p>
<h3><strong>Well, how did we do?</strong></h3>
<p>Let&#8217;s see what it looks like if I simulate light traffic load. The red line indicates request execution time.</p>
<div id="attachment_734" class="wp-caption alignnone" style="width: 842px"><a href="http://benlakey.com/wp-content/uploads/2012/02/output.png"><img class="size-full wp-image-734" title="Output Caching" src="http://benlakey.com/wp-content/uploads/2012/02/output.png" alt="Turning on output caching results in a dramatic drop off in request execution time." width="832" height="417" /></a><p class="wp-caption-text">Turning on output caching results in a dramatic drop off in request execution time.</p></div>
<p>The dramatic drop off occurred when I went into the operations administration panel and changed the TTL. The spikes every 10 seconds following the drop off are when the cache duration TTL expired, forcing the page to actually process again.</p>
<p>There are a number of things we can do to enhance the flexibility of this system. For example, we could specify groupings in the operations administration panel that correspond to cache policies, and then simply specify on each instance of our attribute which policy we&#8217;d like to use:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #008000;">&#91;</span>ConfiguredOutputCache<span style="color: #008000;">&#40;</span>CachePolicy <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;FooCachePolicy&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Index<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> streamSlug<span style="color: #008000;">&#41;</span></pre></div></div>

<p>&nbsp;</p>
<p>We think this feature will be particularly valuable in situations where we need more performance on demand, and look forward to extending it to have more flexibility as needed.</p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2012/02/20/performance-on-demand-giving-your-ops-team-runtime-flexibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS Development Beginnings</title>
		<link>http://benlakey.com/2011/11/21/ios-development-beginnings/</link>
		<comments>http://benlakey.com/2011/11/21/ios-development-beginnings/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 23:21:59 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[iOS Development]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=726</guid>
		<description><![CDATA[Now that I&#8217;ve purchased a Macbook Pro (again), I&#8217;m diving into iOS development. I&#8217;ve decided to keep my notes as I go along, here on the blog. I wouldn&#8217;t necessarily say it&#8217;s for raw public consumption, but that&#8217;s ok since this blog is primarily for selfish reasons. Perhaps someone will get something out of it. [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I&#8217;ve purchased a Macbook Pro (again), I&#8217;m diving into <a href="http://en.wikipedia.org/wiki/IOS" target="_blank">iOS </a>development. I&#8217;ve decided to keep my notes as I go along, here on the blog. I wouldn&#8217;t necessarily say it&#8217;s for raw public consumption, but that&#8217;s ok since this blog is primarily for selfish reasons. Perhaps someone will get something out of it.</p>
<p>I&#8217;m starting off by running through the official Apple documentation on getting started here:  <a href="http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iPhone101/Articles/00_Introduction.html" target="_blank">link</a></p>
<p><a href="http://en.wikipedia.org/wiki/Cocoa_Touch" target="_blank">Cocoa Touch</a> is the framework which iOS apps are built on. <a href="http://en.wikipedia.org/wiki/Cocoa_(API)" target="_blank">Cocoa</a> is the framework which Mac OS X apps are built on. It’s an <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" target="_blank">MVC</a> architecture in both cases.</p>
<p>According to <a href="http://en.wikipedia.org/wiki/Cocoa_Touch" target="_blank">Wikipedia</a>, Cocoa Touch is composed of the following sub-frameworks:</p>
<ul>
<li>Foundation Kit Framework</li>
<li>UIKit Framework (based on Application Kit)</li>
<li>Game Kit Framework</li>
<li>iAd Framework</li>
<li>Map Kit Framework</li>
</ul>
<p>In this first chapter, the following are some mental mappings I&#8217;ve made to my previous knowledge of other languages/frameworks/patterns. There is no 100% mapping exactly, but these are close.</p>
<ul>
<li>‘protocol’ == ‘interface’</li>
<li>‘app delegate’ == ‘message handler’</li>
</ul>
<p>The general theme I’m seeing as I go through the first chapter is that this is a <a href="http://en.wikipedia.org/wiki/Message-oriented_middleware" target="_blank">message based architecture</a>, similar to a <a href="http://en.wikipedia.org/wiki/Enterprise_service_bus" target="_blank">bus</a>, with message handlers (delegates). The delegation can pass the messages along. This is of course very high level and will require refinement as I go along.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/11/21/ios-development-beginnings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Encapsulation</title>
		<link>http://benlakey.com/2011/11/19/javascript-encapsulation/</link>
		<comments>http://benlakey.com/2011/11/19/javascript-encapsulation/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 22:00:30 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[abstraction]]></category>
		<category><![CDATA[encapsulation]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[software craftsmanship]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=713</guid>
		<description><![CDATA[After having read Douglas Crockford&#8217;s book &#8220;Javascript: The Good Parts&#8221;, I had learned some ways to leverage objects and information hiding, in the following manner: var fooInstance = function&#40;&#41; &#123; &#160; var privateAlpha; &#160; return &#123; &#160; getAlpha: function&#40;&#41; &#123; return privateAlpha; &#125;, &#160; setAlpha: function&#40;a&#41; &#123; privateAlpha = a; &#125; &#160; &#125;; &#160; &#125;&#40;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>After having read Douglas Crockford&#8217;s book &#8220;Javascript: The Good Parts&#8221;, I had learned some ways to leverage objects and information hiding, in the following manner:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> fooInstance <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> privateAlpha<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		getAlpha<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">return</span> privateAlpha<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
		setAlpha<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			privateAlpha <span style="color: #339933;">=</span> a<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
fooInstance.<span style="color: #660066;">setAlpha</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>fooInstance.<span style="color: #660066;">getAlpha</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//10</span>
fooInstance.<span style="color: #660066;">setAlpha</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>fooInstance.<span style="color: #660066;">getAlpha</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//20</span></pre></div></div>

<p>However, if you do a quick search on StackOverflow, you&#8217;ll quickly encounter a huge number of answers on javascript questions which say not to bother with private variables. Their reasoning is &#8220;well, you can just look at the javascript source in the browser, so what&#8217;s the point?&#8221;. This is missing part of the point.</p>
<p>One of the primary points of encapsulation is to control the internal state of the object, by only providing a limited interface. This protects the integrity of the state.</p>
<p>BUT&#8230; the other purpose of private variables and encapsulation in any language is not simply security or protection from nefarious people. It&#8217;s abstraction. An external entity should not need or care to know how the internals are accomplished. The smaller the footprint of the interface, the less complexity exists for the consumer to understand. You should expose no more than is necessary to leverage the functionality. The result of doing so is code that has looser coupling and is easier to understand by those who wish to consume it.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/11/19/javascript-encapsulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Old Republic at Ben&#8217;s</title>
		<link>http://benlakey.com/2011/10/24/the-old-republic-at-bens/</link>
		<comments>http://benlakey.com/2011/10/24/the-old-republic-at-bens/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 06:07:33 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=710</guid>
		<description><![CDATA[While not really relating to Software Development, I should point out that I&#8217;ve created another blog covering Star Wars: The Old Republic, the new MMO coming out in December. Check it out here: http://benlakey.com/tor/]]></description>
			<content:encoded><![CDATA[<p>While not really relating to Software Development, I should point out that I&#8217;ve created <a title="The Old Republic at Ben's" href="http://benlakey.com/tor/" target="_blank">another blog</a> covering <a title="Star Wars: The Old Republic" href="http://www.swtor.com" target="_blank">Star Wars: The Old Republic</a>, the new MMO coming out in December.</p>
<p>Check it out here: <a title="The Old Republic at Ben's" href="http://benlakey.com/tor/" target="_blank">http://benlakey.com/tor/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/10/24/the-old-republic-at-bens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing List Indexer</title>
		<link>http://benlakey.com/2011/09/27/introducing-list-indexer/</link>
		<comments>http://benlakey.com/2011/09/27/introducing-list-indexer/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 06:13:27 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[backbone.js]]></category>
		<category><![CDATA[listindexer]]></category>
		<category><![CDATA[ravendb]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=573</guid>
		<description><![CDATA[I decided to create a simple web app using ASP.NET MVC 3, Backbone.js, and Raven DB. The result is List Indexer (listindexer.com). It&#8217;s very simple, and similar to things like bit.ly, except that its intent is to persist and share lists. Examples: Grocery list, wish list, favorite things, top 10 tech companies. Give it a try, [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to create a simple web app using ASP.NET MVC 3, <a href="http://documentcloud.github.com/backbone/">Backbone.js</a>, and <a href="http://ravendb.net/">Raven DB</a>. The result is <a href="http://listindexer.com">List Indexer</a> (<a href="http://listindexer.com">listindexer.com</a>). It&#8217;s very simple, and similar to things like <a href="http://bit.ly">bit.ly</a>, except that its intent is to persist and share lists. Examples: Grocery list, wish list, favorite things, top 10 tech companies.</p>
<p>Give it a try, and let me know what you think. Feel free to log issues or suggestions at it&#8217;s github site here: <a href="https://github.com/benlakey/ListIndexer">ListIndexer at GitHub</a></p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/09/27/introducing-list-indexer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Complexity</title>
		<link>http://benlakey.com/2011/09/16/complexity/</link>
		<comments>http://benlakey.com/2011/09/16/complexity/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 02:36:31 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[software craftsmanship]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=560</guid>
		<description><![CDATA[&#8220;Computer programs are the most complex things that humans make. Programs are made up of a huge number of parts, expressed as functions, statements, and expressions that are arranged in sequences that must be virtually free of error. The runtime behavior has little resemblance to the program that implements it. Software is usually expected to [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;Computer programs are the most complex things that humans make. Programs are made up of a huge number of parts, expressed as functions, statements, and expressions that are arranged in sequences that must be virtually free of error. The runtime behavior has little resemblance to the program that implements it. Software is usually expected to be modified over the course of its productive life. <strong>The process of converting one correct program into a different correct program is extremely challenging.&#8221;</strong></p>
<p><em>-Douglas Crockford</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/09/16/complexity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How do you measure programmer productivity?</title>
		<link>http://benlakey.com/2011/08/26/how-do-you-measure-programmer-productivity/</link>
		<comments>http://benlakey.com/2011/08/26/how-do-you-measure-programmer-productivity/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 18:20:34 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[software craftsmanship]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=555</guid>
		<description><![CDATA[How do you measure programmer productivity? When the Lisa team was pushing to finalize their software in 1982, project managers started requiring programmers to submit weekly forms reporting on the number of lines of code they had written. Bill Atkinson thought that was silly. For the week in which he had rewritten QuickDraw’s region calculation [...]]]></description>
			<content:encoded><![CDATA[<p>How do you measure programmer productivity?</p>
<blockquote><p>When the Lisa team was pushing to finalize their software in 1982, project managers started requiring programmers to submit weekly forms reporting on the number of lines of code they had written. Bill Atkinson thought that was silly. For the week in which he had rewritten QuickDraw’s region calculation routines to be six times faster and 2000 lines shorter, he put &#8220;-2000&#8243; on the form. After a few more weeks the managers stopped asking him to fill out the form, and he gladly complied.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/08/26/how-do-you-measure-programmer-productivity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feedback Loops</title>
		<link>http://benlakey.com/2011/08/23/feedback-loops/</link>
		<comments>http://benlakey.com/2011/08/23/feedback-loops/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 22:44:50 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=550</guid>
		<description><![CDATA[I originally posted this on our development blog over at MSNBC. Are you familiar with feedback loops? A feedback loop is a loop in which information encountered by the system is fed back into the system, and the system can then respond to it. You&#8217;ve probably seen a diagram similar to this: Feedback loops are [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>I originally posted this on our <a title="Feedback Loops" href="http://development.msnbc.msn.com/_news/2011/08/22/7443383-feedback-loops">development blog over at MSNBC</a>.</strong></em></p>
<p>Are you familiar with feedback loops? A feedback loop is a loop in which information encountered by the system is fed back into the system, and the system can then respond to it. You&#8217;ve probably seen a diagram similar to this:</p>
<p><a href="http://benlakey.com/wp-content/uploads/2011/09/loop.jpg"><img class="alignnone size-medium wp-image-571" title="loop" src="http://benlakey.com/wp-content/uploads/2011/09/loop-300x105.jpg" alt="" width="300" height="105" /></a></p>
<p>Feedback loops are very important for a system since they allow the system to evolve and adapt to change. A great example of this seen in nature is the human body&#8217;s temperature regulation:</p>
<p><a href="http://benlakey.com/wp-content/uploads/2011/09/body.jpg"><img class="alignnone size-full wp-image-570" title="body" src="http://benlakey.com/wp-content/uploads/2011/09/body.jpg" alt="" width="276" height="113" /></a></p>
<p>Without feedback, the body would have no way of making the minor adjustments it needs.</p>
<p>Feedback loops turn out to be extremely valuable in software development as well. Agile development practices all relate to the notion of a feedback loop:</p>
<ul>
<li>Unit tests</li>
<li>Pair Programming</li>
<li>Sprints</li>
<li>Stand-up meetings</li>
<li>Code reviews</li>
</ul>
<p>You may notice something about these practices; The feedback loops are very fast. Feedback loops that are slow are of little value, because by the time you respond to one set of feedback, the next may have already arrived, which would render your initial response meaningless.</p>
<p>In the example of body temperature regulation, it would be pretty useless to have the body react with sweat hours after a temperature change occurs.</p>
<p>We want feedback loops to be as fast as possible so that we can find out whats working, whats not working, and what needs to change right now.</p>
<ol>
<li>Change something</li>
<li>Find out how it went</li>
<li>Learn from it and adjust</li>
<li>Rinse and repeat</li>
</ol>
<p>Automation is a great way to achieve our feedback loop goals in software development. In addition to the agile practices above, we can also try to implement the following whenever possible:</p>
<ul>
<li>Continuous integration</li>
<li>Increasing the frequency at which code is released</li>
<li>Automated acceptance tests</li>
<li>Automated code analysis</li>
</ul>
<p>A set of tight feedback loops like these can allow us to respond to change rapidly. Every time someone checks in code, the automation can tell us immediately whether we are in a healthy state, which will allow us to immediately correct any problems if they occur.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/08/23/feedback-loops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Law of Demeter</title>
		<link>http://benlakey.com/2011/07/18/the-law-of-demeter/</link>
		<comments>http://benlakey.com/2011/07/18/the-law-of-demeter/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 05:14:54 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[abstraction]]></category>
		<category><![CDATA[encapsulation]]></category>
		<category><![CDATA[oo]]></category>
		<category><![CDATA[software craftsmanship]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=544</guid>
		<description><![CDATA[Hello boys and girls, it&#8217;s been a while. Let&#8217;s talk about OO design. Have you heard of the Law of Demeter? If you develop software, you should. You may actually be familiar with its concepts without actually knowing that it had a formal name. At it&#8217;s core, the Law of Demeter is the explicit capture [...]]]></description>
			<content:encoded><![CDATA[<p>Hello boys and girls, it&#8217;s been a while. Let&#8217;s talk about OO design.</p>
<p>Have you heard of the <a href="http://en.wikipedia.org/wiki/Law_of_Demeter">Law of Demeter</a>? If you develop software, you should. You may actually be familiar with its concepts without actually knowing that it had a formal name. At it&#8217;s core, the Law of Demeter is the explicit capture of the intent of encapsulation. The rules are as follows.</p>
<p>A method <strong>FooMethod</strong> of a class <strong>Foo</strong> should only call the methods of these:</p>
<ul>
<li>Foo</li>
<li>An object created by FooMethod</li>
<li>An object passed as an argument to FooMethod</li>
<li>An object reference held as an instance variable of Foo</li>
</ul>
<p><a href="http://en.wikipedia.org/wiki/Robert_Cecil_Martin">Uncle Bob</a> summarizes it nicely: &#8220;In other words, talk to friends, not to strangers.&#8221;</p>
<p>This all sounds dandy and obvious, but it&#8217;s easy to forget and slip up when dealing with complicated designs, or designs that are poorly understood.</p>
<p>Happy coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/07/18/the-law-of-demeter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Criticality and Communication</title>
		<link>http://benlakey.com/2011/06/15/criticality-and-communication/</link>
		<comments>http://benlakey.com/2011/06/15/criticality-and-communication/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 18:16:38 +0000</pubDate>
		<dc:creator>benlakey</dc:creator>
				<category><![CDATA[benlakey.com]]></category>
		<category><![CDATA[soft skills]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://benlakey.com/?p=538</guid>
		<description><![CDATA[The title of this blog post was originally to be &#8216;criticism&#8217;, but This Developer&#8217;s Life already used that. I suppose it&#8217;s for the best anyhow, since the idea behind this post is to address not only criticism, but the ability to communicate as well. It stems from a discussion my wife and I had as [...]]]></description>
			<content:encoded><![CDATA[<p>The title of this blog post was originally to be &#8216;criticism&#8217;, but <a href="http://www.thisdeveloperslife.com">This Developer&#8217;s Life</a> already <a href="http://www.thisdeveloperslife.com/post/2-0-1-criticism">used that</a>. I suppose it&#8217;s for the best anyhow, since the idea behind this post is to address not only criticism, but the ability to communicate as well. It stems from a discussion my wife and I had as we walked home from a <a href="http://www.reddit.com/r/Seattle/comments/hyrui/lord_of_the_rings_extended_version_screenings/">screening of the extended edition of Lord of the Rings: Fellowship of the Ring</a> last night.</p>
<p>Being a nerd, engineer, computer scientist, programmer, coder, web developer, or any other such title that you can lump us into, is <strong>hard</strong>. It&#8217;s not only hard because of the increasing complexities of emerging technologies. Some of the biggest difficulty for us is actually around interpersonal relationship skills. We find others to be strange, alien creatures, who we do not understand. We marvel at how easily it can come to some, but at the same time look with a perplexed eye, since we do not think as they do. Why is this? It&#8217;s because we see the world through monochrome tinted glasses; We see a world of boolean logic, in which something either is, or it isn&#8217;t. It is with this polarizing conviction that we derive our deep seated views, holy wars about technologies, and get extremely testy when confronted. Further, because the world is of course not black and white, true or false, we find middle ground to be&#8230; uncomfortable. So then what you end up with is a personality type that is not only polarized, but also critical. We are critical of those things which are not tidied, tied off, cleaned up, made parallel, and understood. It&#8217;s really a double edged sword.</p>
<p>So, when you confront someone with a different view from their own, and that view is firmly seated in their mind, what happens? The reaction is, perhaps surprising, perhaps not, that they actually will stick to what they know more adamantly than before. This is known in the psychology community as the &#8216;<a href="http://youarenotsosmart.com/2011/06/10/the-backfire-effect/">backfire effect</a>&#8216;. My wife posits that this could actually be the cause of many of the world&#8217;s serious problems, such as religious wars, government policy stance on moral issues, etc. So what is one supposed to do to attempt to pry open anothers mind? How do we do it without seeming like we&#8217;re forcing our views on theirs? We just want to crack through ever so slightly, so as to allow alternative perspectives to enter their locked mind. I&#8217;m not sure I have the answer on how to do this. Maybe you do.</p>
<p>Nerd psychology is a vast, complex topic. The personality of the &#8216;alpha geek&#8217; is so pervasive in the industry of software engineering, that you can often times learn how to deal with many, by just basing your interactions off of one. The attitudes of &#8220;I know it all&#8221;, and &#8220;this way is best&#8221;, and &#8220;obviously this technology X is not as good as Y&#8221;, are like a poison, a poison which threatens to turn our programmers world of creation into a cesspool of bickering, snapping at one another, dismissing eachother as not intelligent, and an all around gnashing of teeth. Too often this poison presents itself, and when it does, its typically accompanied by a very unpleasant, snarky, &#8220;I&#8217;m better than you&#8221; attitude. This attitude leaks through in a very obvious way, even when it is not vocalized or intended to be communicated. We must drive this poison out, and attempt to make eachother see the world through a spectrum of colors. The value of other perspectives in software engineering cannot be overstated, and is too often a blind spot for otherwise gifted developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://benlakey.com/2011/06/15/criticality-and-communication/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

