<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>My Digital Neuron</title>
	<atom:link href="http://benhutchison.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://benhutchison.wordpress.com</link>
	<description>Ben Hutchison's contribution to our Internet mind</description>
	<lastBuildDate>Fri, 13 Jan 2012 15:25:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='benhutchison.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/694ac53a21a7d6fb1662392f95a6e9e8?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>My Digital Neuron</title>
		<link>http://benhutchison.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://benhutchison.wordpress.com/osd.xml" title="My Digital Neuron" />
	<atom:link rel='hub' href='http://benhutchison.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Heroscape 2.0 Slides from Melbourne Scala user group presentation</title>
		<link>http://benhutchison.wordpress.com/2011/05/03/heroscape-2-0-slides-from-melbourne-scala-user-group-presentation/</link>
		<comments>http://benhutchison.wordpress.com/2011/05/03/heroscape-2-0-slides-from-melbourne-scala-user-group-presentation/#comments</comments>
		<pubDate>Tue, 03 May 2011 13:06:10 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=244</guid>
		<description><![CDATA[HeroscapeMkIICaseStudy Attached are the slides from my April 2011 Melbourne Scala user group presentation, on &#8220;Heroscape 2.0:  A case study in using Scala for complex HTML document generation&#8221;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=244&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://benhutchison.files.wordpress.com/2011/05/heroscapemkiicasestudy.pdf">HeroscapeMkIICaseStudy</a></p>
<p>Attached are the slides from my April 2011 Melbourne Scala user group presentation, on &#8220;Heroscape 2.0:  A case study in using Scala for complex HTML document generation&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/244/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=244&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2011/05/03/heroscape-2-0-slides-from-melbourne-scala-user-group-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
		<item>
		<title>State of Scala 2010 slides from OSDC</title>
		<link>http://benhutchison.wordpress.com/2011/05/03/state-of-scala-2010-slides-from-osdc/</link>
		<comments>http://benhutchison.wordpress.com/2011/05/03/state-of-scala-2010-slides-from-osdc/#comments</comments>
		<pubDate>Tue, 03 May 2011 12:56:18 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=240</guid>
		<description><![CDATA[StateOfScala Here are the slides from a &#8220;State of Scala&#8221; talk I gave at OSDC in November 2010, summarizing where Scala is currently at. http://2010.osdc.com.au/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=240&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://benhutchison.files.wordpress.com/2011/05/stateofscala.pdf">StateOfScala</a></p>
<p>Here are the slides from a &#8220;State of Scala&#8221; talk I gave at <a href="http://2010.osdc.com.au/">OSDC </a>in November 2010, summarizing where Scala is currently at.</p>
<p>http://2010.osdc.com.au/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=240&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2011/05/03/state-of-scala-2010-slides-from-osdc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
		<item>
		<title>In search of something better than Test-Driven Development</title>
		<link>http://benhutchison.wordpress.com/2011/02/11/in-search-of-something-better-than-test-driven-development/</link>
		<comments>http://benhutchison.wordpress.com/2011/02/11/in-search-of-something-better-than-test-driven-development/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 15:16:07 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=236</guid>
		<description><![CDATA[My previous post was perhaps a bit symbolic (or plain smart-arse) and in need some some explanation. In simple terms, it is a lament about the shortcomings off Test- (aka Behavior) Driven Development (TDD or BDD), a testing practice that is widely considered current best practice for software engineering, or least my experience of doing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=236&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My previous post was perhaps a bit symbolic (or plain smart-arse) and in need some some explanation.</p>
<p>In simple terms, it is a lament about the shortcomings off Test- (aka Behavior) Driven Development (TDD or BDD), a testing practice that is widely considered current best practice for software engineering, or least my experience of doing it.</p>
<p>In this method, software is constructed by first building executable tests, or specifications, that function somewhat like moulds in the casting of metals or plastics; they determine form of the software by specifying very precisely how it must behave. This takes more of the time and effort; once the specifications are constructed, it is usually less effort to construct the software to satisfy them.</p>
<p>Its been discovered, by myself empirically, but also by many others, that using many fine-grained, non-overlapping, unit tests yields software and tests that are easier/cheaper to build and maintain. However, an uncanny thing happens to unit tests as they become fine-grained: they start to look eerily similar to, or perhaps mirror images of, the code they specify.</p>
<p>So, the mirrors halves of photo in the previous post represents the two sides of a system (in this case, the text on the sign): the code (on the left), and the tests (on the right). What I was seeking to highlight is how the <em>information content </em>of the system has not been increased by adding the tests. We have said the <em>same thing twice</em>: once, as code, and again, as tests over that code.</p>
<p>What we have added is <em>redundancy</em>, which serves to <em>detect errors</em>, just as redundancy does in error correcting memory or RAID disks.</p>
<p>So, to me, the essence of the TDD practices is actually to ensure redundancy in a system&#8217;s specification. When the 2 copies of the specification, Code and Tests, do not agree, we have a <em>test failure</em> that is easily detected.</p>
<p>My problems with present day TDD are that</p>
<ol>
<li>This redundancy is currently achieved by enormous manual effort. In the <em>most efficient</em> cases Ive seen where system behavior is 100% specified by tests, test code is typically 200% of the bulk of the code it specifies, and it can be far worse, 300-400% is not uncommon. In my experience, that consumes a great deal of effort/time/money.</li>
<li>It seems very difficult to measure or control the level of redundancy in the system introduced by the TDD practices. There seems to be a tendency to prescribe a &#8220;one-size-fits-all&#8221; approach of 100% unit test redundancy (ie every line, every branch, every data case in code covered by a unit test) as being appropriate for every project.<br />
In contrast, when we use redundancy to control errors for information storage or transmission, the amount of redundancy is a parameter that we can freely vary, to achieve a trade-off between bulky robustness and lightweight delicateness. We need to find a similar variable dial for software testing practices.</li>
<li>When we develop software in the TDD style, we are writing down the same pieces of information twice in 2 ledgers as we work: Write a test. Write the matching code. Execute and verify matching. Rinse and Repeat.<br />
For me, that feels tedious and unnatural. My instinct is to write it once, and see it execute, to engage in a flowing conversation with the compiler and the runtime.</li>
</ol>
<p>Ive been thinking alot lately about what could replace TDD, to give us reliable software at more lightweight redundancy levels, in the 10-50% of code size range, rather than the 100%+ redundancy of textbook TDD. Some early ideas:</p>
<ul>
<li>Static Typing</li>
<li>Dependent Types</li>
<li>Design by Contract (which seems partly isomorphic to the very powerful Property-Based Testing approaches)</li>
<li>Automatic type-driven generation of function inputs, so that function can be executed without explicitly writing tests (The other half of Property-Based Testing).</li>
<li>Inline executable Examples, expressed as annotations, that describe valid sample function inputs and corresponding outputs, much as tests do, but much closer to the code.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=236&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2011/02/11/in-search-of-something-better-than-test-driven-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
		<item>
		<title>it should have a title that is &#8220;Man having serious doubts about whether saying everything twice is actually the best we software engineers can do&#8221;</title>
		<link>http://benhutchison.wordpress.com/2011/02/10/self-portrait/</link>
		<comments>http://benhutchison.wordpress.com/2011/02/10/self-portrait/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 09:21:59 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=226</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=226&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><a href="http://benhutchison.files.wordpress.com/2011/02/tdd.jpg"><img class="aligncenter " title="it should have a title that is &quot;Man having seriously doubts about whether saying everything twice is actually the best we software engineers can do. &quot;" src="http://benhutchison.files.wordpress.com/2011/02/tdd.jpg?w=1024&#038;h=811" alt="" width="1024" height="811" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=226&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2011/02/10/self-portrait/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>

		<media:content url="http://benhutchison.files.wordpress.com/2011/02/tdd.jpg" medium="image">
			<media:title type="html">it should have a title that is &#34;Man having seriously doubts about whether saying everything twice is actually the best we software engineers can do. &#34;</media:title>
		</media:content>
	</item>
		<item>
		<title>Easy solutions for Caching in the JVM</title>
		<link>http://benhutchison.wordpress.com/2010/06/22/an-easy-solution-for-caching-in-the-jvm/</link>
		<comments>http://benhutchison.wordpress.com/2010/06/22/an-easy-solution-for-caching-in-the-jvm/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 06:53:12 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=217</guid>
		<description><![CDATA[Bounded LRU Cache A common use case. A cache data structure that: has a bounded maximum size and thus memory consumption (which in turn implies a cache eviction policy like LRU) is safe and performant for concurrent use AFAICT, there&#8217;s nothing in the JDK or the concurrency JSRs that hits both these requirements. I googled [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=217&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Bounded LRU Cache</strong></p>
<p>A common use case. A cache data structure that:</p>
<ul>
<li>has a bounded maximum size and thus memory consumption (which in turn implies a cache eviction policy like <a href="http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used">LRU</a>)</li>
<li>is safe and performant for concurrent use</li>
</ul>
<p>AFAICT, there&#8217;s nothing in the JDK or the concurrency JSRs that hits both these requirements.  I googled and found the open source <a href="http://code.google.com/p/concurrentlinkedhashmap/">Concurrent Linked Hashmap library</a>, which does.</p>
<p>[An incorrect comment about the project missing tests has been removed]</p>
<p><strong>Unbounded Garbage Collectable Cache</strong></p>
<p>If instead, you want a cache that will grow with use, but can be reclaimed if memory is short, then the use of a <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/extra166ydocs/extra166y/ConcurrentReferenceHashMap.html">ConcurrentReferenceHashMap</a>, configured with <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/SoftReference.html">SoftReferences</a>, is a good solution.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/217/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=217&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2010/06/22/an-easy-solution-for-caching-in-the-jvm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
		<item>
		<title>Escape Analysis changes the rules for performance critical code</title>
		<link>http://benhutchison.wordpress.com/2009/10/09/escape-analysis-changes-the-rules-for-performance-critical-code/</link>
		<comments>http://benhutchison.wordpress.com/2009/10/09/escape-analysis-changes-the-rules-for-performance-critical-code/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 08:27:05 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=209</guid>
		<description><![CDATA[The last few days its been dawning on me how Escape Analysis changes the rules on performance critical code. Its a big deal. Short lived objects become nearly free to use. Convenience rules. If you need to tuple-ize 2 Ints, then stick them in a List, to pass through an API, only to immediately unpack [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=209&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The last few days its been dawning on me how <a href="http://en.wikipedia.org/wiki/Escape_analysis">Escape Analysis </a>changes the rules on performance critical code.</p>
<p>Its a big deal. Short lived objects become nearly free to use. Convenience rules. If you need to tuple-ize 2 Ints, then stick them in a List, to pass through an API, only to immediately unpack back to the Ints on the other side: <em>go ahead</em>. <em>Dont worry. </em>Those objects probably will never be created; they&#8217;re <em>conceptually</em> there.</p>
<p>Get back to what you ought to be doing: Abstracting and Composing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=209&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2009/10/09/escape-analysis-changes-the-rules-for-performance-critical-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
		<item>
		<title>Arcadia&#8217;s level editor lives again</title>
		<link>http://benhutchison.wordpress.com/2009/07/06/arcadias-level-editor-lives-again/</link>
		<comments>http://benhutchison.wordpress.com/2009/07/06/arcadias-level-editor-lives-again/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 09:15:05 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=205</guid>
		<description><![CDATA[This is a sight I havent seen for 3 months &#8211; my game&#8217;s level editor working. Its a relief to have it back (partially). Heavy refactoring of game code, technical debt and experimentation have conspired to make it broken. Its taken much of the past month to fix.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=205&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a sight I havent seen for 3 months &#8211; my game&#8217;s level editor working. Its a relief to have it back (partially).</p>
<p>Heavy refactoring of game code, technical debt and experimentation have conspired to make it broken. Its taken much of the past month to fix.</p>
<p><img class="aligncenter size-full wp-image-204" title="Resource_-_ArcadiaResourcesScenariosNuWoodhaven.scenario.xml_-_Eclipse_SDK-2009.07.06-19.03.27" src="http://benhutchison.files.wordpress.com/2009/07/resource_-_arcadiaresourcesscenariosnuwoodhaven-scenario-xml_-_eclipse_sdk-2009-07-06-19-03-27.jpg?w=477&#038;h=328" alt="Resource_-_ArcadiaResourcesScenariosNuWoodhaven.scenario.xml_-_Eclipse_SDK-2009.07.06-19.03.27" width="477" height="328" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=205&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2009/07/06/arcadias-level-editor-lives-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>

		<media:content url="http://benhutchison.files.wordpress.com/2009/07/resource_-_arcadiaresourcesscenariosnuwoodhaven-scenario-xml_-_eclipse_sdk-2009-07-06-19-03-27.jpg" medium="image">
			<media:title type="html">Resource_-_ArcadiaResourcesScenariosNuWoodhaven.scenario.xml_-_Eclipse_SDK-2009.07.06-19.03.27</media:title>
		</media:content>
	</item>
		<item>
		<title>XSL for Xml Schema Migration &amp; Data Transformation</title>
		<link>http://benhutchison.wordpress.com/2009/07/06/xsl-for-xml-schema-migration-data-transformation/</link>
		<comments>http://benhutchison.wordpress.com/2009/07/06/xsl-for-xml-schema-migration-data-transformation/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 02:20:23 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=196</guid>
		<description><![CDATA[Ive recently been using XSL to do schema migration on XML data; ie small, incremental modifications to XML where most of the existing data is preserved. The application was to massage some Heroes of Arcadia level data, serialized with XStream, to keep in step with code changes I&#8217;d made. First I tried using Scala&#8217;s scala.xml.transform.RewriteRule, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=196&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ive recently been using XSL to do schema migration on XML data; ie small, incremental modifications to XML where most of the existing data is preserved. The application was to massage some Heroes of Arcadia level data, serialized with XStream, to keep in step with code changes I&#8217;d made.</p>
<p>First I tried using Scala&#8217;s<a href="http://www.scala-lang.org/docu/files/api/scala/xml/transform/RewriteRule.html"> scala.xml.transform.RewriteRule</a>, but hit some bugs (#2124 and #2125) that convinced me to let it stabilize further before applied use.</p>
<p>So instead I used the new<a href="http://wiki.eclipse.org/XSLT_Project"> XSL support</a> in Eclipse 3.5  (in WTP 3.1). Seems to work well.</p>
<p>I&#8217;d only used XSL back in 2001 and never fully understood it. I found most entry level tutorials (eg ZVON and W3 Schools) unhelpful for this kind of application, because they don&#8217;t explain copy existing nodes well.</p>
<p>My breakthrough came when I discovered Jesper Tverskov&#8217;s article on the <a href="http://www.xmlplease.com/xsltidentity#s9">Identity Template</a>. This explains how to recursively process XML by copying with modification.</p>
<p>One case Jesper doesnt cover is copying where segments of the subtree are omitted and others are retained but modified.</p>
<p>I solved that in my template by using a <strong>&lt;for-each&gt;</strong> to pickout the subtree part I wanted to preserve, wrapping the <strong>&lt;xsl:copy&gt;&lt;xsl:apply-templates select=&#8221;@*|node()&#8221;/&gt;&lt;/xsl:copy&gt;</strong> structure thats fundamental to recursive processing.</p>
<pre>&lt;xsl:template match="@*|node()"&gt;
&lt;xsl:copy&gt;
&lt;xsl:apply-templates select="@*|node()"/&gt;
&lt;/xsl:copy&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="//vector[default]"&gt;
&lt;size&gt;&lt;xsl:value-of select="default/elementCount"/&gt;&lt;/size&gt;
&lt;xsl:for-each select="default/elementData" &gt;
&lt;xsl:copy&gt;
&lt;xsl:apply-templates select="@*|node()"/&gt;
&lt;/xsl:copy&gt;
&lt;/xsl:for-each&gt;
&lt;/xsl:template&gt;</pre>
<p>Sample input and output:</p>
<pre>&lt;__features id="50" serialization="custom"&gt;
&lt;vector&gt;
&lt;default&gt;
&lt;capacityIncrement&gt;4&lt;/capacityIncrement&gt;
&lt;elementCount&gt;1&lt;/elementCount&gt;
&lt;elementData id="51"&gt;
&lt;arcadia.domain.Unit reference="46"/&gt;
&lt;null/&gt;
&lt;null/&gt;
&lt;null/&gt;
&lt;null/&gt;
&lt;/elementData&gt;
&lt;/default&gt;
&lt;/vector&gt;
&lt;/__features&gt;

&lt;__features id="50" serialization="custom"&gt;
&lt;size&gt;1&lt;/size&gt;
&lt;elementData id="51"&gt;
&lt;arcadia.domain.Unit reference="46"/&gt;
&lt;null/&gt;
&lt;null/&gt;
&lt;null/&gt;
&lt;null/&gt;
&lt;/elementData&gt;
&lt;/__features&gt;
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=196&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2009/07/06/xsl-for-xml-schema-migration-data-transformation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
		<item>
		<title>Appropriate Use of Mutable Data in Functional Software Systems</title>
		<link>http://benhutchison.wordpress.com/2009/06/15/appropriate-use-of-mutable-data-in-object-functional-systems/</link>
		<comments>http://benhutchison.wordpress.com/2009/06/15/appropriate-use-of-mutable-data-in-object-functional-systems/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 05:38:28 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=178</guid>
		<description><![CDATA[Since I wrote this post, I have become aware of Rich Hickey&#8217;s discussion of State and Identity on Clojure.org. I feel he expresses the same truths in a generally clearer, sharper way than I have managed to here&#8230; ++++++++++++++++++ This post arose out of a Twitter discussion with Daniel Spiewak on twitter. I dont know [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=178&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since I wrote this post, I have become aware of Rich Hickey&#8217;s discussion of <a href="http://clojure.org/state">State and Identity</a> on Clojure.org. I feel he expresses the same truths in a generally clearer, sharper way than I have managed to here&#8230;</p>
<p>++++++++++++++++++</p>
<p>This post arose out of a Twitter <a href="http://twitter.com/djspiewak/status/2171480174">discussion </a>with <a href="http://www.codecommit.com/blog/">Daniel Spiewak</a> on twitter. I dont know whether Newton could have encoded his laws of Mechanics into 140 characters, but I need more space to share my thoughts on the (hopefully) simpler matter of: <em>What is appropriate use of Mutable Data in Functional software systems</em>?</p>
<p><strong>Entities and Identities</strong></p>
<p>I feel the answer is inter-connected with the idea of <em>Identity</em> represented by the data in a software system. As <a href="http://en.wikipedia.org/wiki/Domain-driven_design">Eric Evans</a> explained so well, data that has a strong identity is called an <a href="http://domaindrivendesign.org/node/109"><em>Entity</em></a>.</p>
<p>A classic example, present in almost every business software system, is some &#8220;User Entity&#8221;, modeling a person&#8217;s account in that system. In such a system, when we speak about a particular User, conceptually we really want there to be <em>only one </em>such entity in existence.</p>
<p>The identity of an entity is normally governed by a <em>unique </em>&amp; <em>immutable </em>primary key. Other than the primary key, everything attribute of the entity may change. A User, for example, might change their favorites list, address, name or possibly even sex.</p>
<p><strong>Functional Interaction with Entities</strong></p>
<p>Conceptually there&#8217;s only one entity. But actually, there&#8217;s only one &#8220;offical version&#8221;, and other possibly divergent versions, which may be promoted to official status.</p>
<p>Entities should be accessed via transactions (in broadest sense, including <a href="http://en.wikipedia.org/wiki/Software_transactional_memory">STM </a>or concurrent data structures). A functional program makes an immutable snapshot of the entity at some time. It may derive an updated version of the entity from that, and then request that its copy be promoted as the &#8220;master&#8221; copy. Typically, this promotion would be done using optimistic concurrency, so that if another process changed the entity first, the update must retry. But other models (eg pessimistic concurr, change merging) might be used instead.</p>
<p>Note that</p>
<ul>
<li>An executing program has no guarantee that it operates on the &#8220;latest&#8221; version of an entity.</li>
<li>After the fact, it is possible to say &#8220;at time X, the official state of the entity was thus&#8230;&#8221;, by time-stamping updates. This is important, for example, in a legal case if we wanted to know who owned some property at a particular point in time in a dispute.</li>
<li>This is <a href="http://en.wikipedia.org/wiki/Concurrent_computing">either Shared State and Message Passing concurrency</a>. We can view the &#8220;official entity version&#8221; as shared state, or as an agent to whom we send read-entity and write-entity messages.</li>
</ul>
<p>Pretty much as Daniel put it (borrowed from Clojure, apparently) <a href="http://twitter.com/djspiewak/status/2172192522">&#8220;<span><span>Everything is immutable except for concurrency-safe entities</span></span>&#8220;</a></p>
<p><strong>The meaning of Entity Update</strong></p>
<p>Something special happens when an entity&#8217;s master state is updated. This is the synchronization/convergence point between separate threads and components. It is the boundary between the functional code, which transforms some input state into some new entity states, and the imperative world of sequentially updating mutable state. It is the end of a Unit of Work, a time when a functional program says &#8220;this is not a means to an end, this is the end&#8221;. The transient becomes persisted, allowing the state in the current moment to affect and interact with other points in time.</p>
<p><strong>Granularity, </strong><strong> </strong><strong>Scalability </strong><strong> </strong><strong>and Consistency<br />
</strong></p>
<p>So how many entities do we need? Coarse or fine grained? A few larger, internally complex entities, or many simpler and smaller entities?</p>
<p>Its a matter of chosing a point on a spectrum whose extremes are</p>
<ul>
<li>A single StateOfTheWorld entity whose attributes encompass all data in the system. As in a purely functional system; the program sees only its own private version of state, without any interference.</li>
<li>Every tiny piece of data is its own entity. This would be like programming only with atomic global variables. Everyone sees and shares all state without privacy.</li>
</ul>
<p>I don&#8217;t think there&#8217;s one &#8220;right&#8221; answer. All I can offer is an outline of some design forces acting in either direction:</p>
<p>Fewer Entities each containing more data</p>
<ul>
<li><strong>For: data consistency within an entity</strong>. A coarse grained entity starts in a consistent state and is never externally updated. A program is free to compute changes to the entity&#8217;s state independently without risk of being disrupted by other program&#8217;s updates. The benefits of the purely functional model accrue.</li>
<li><strong>Against: Contention if multiple processes try to simultaneously update the same entity</strong>. For an extreme example, imagine if two functional programs simulatneously computed a new StateOfTheWorld entity &#8211; they would operate in a perpetual state of fatal contention.</li>
<li><strong>Against: Copying Overhead. </strong>Need to copy minimum of log(N)  (where N is the &#8220;size&#8221; of the entity), and often much more, of an entity&#8217;s data to update it.</li>
</ul>
<p>More Entities each containing less data</p>
<ul>
<li><strong>For: Less copying overhead. </strong>We still need to copy minimum of log(N)  of an entity&#8217;s data to update it, but N is smaller.</li>
<li><strong>For: Less contention </strong>when multiple processes try to simultaneously update entities, because the updates are spread across more fine-grained locks.</li>
<li><strong>Against: data inconsistency between inter-related entities.</strong> We either have to tolerate inconsistency between entities (eg Person entity &#8216;Ben&#8217; has a son &#8216;Otto&#8217;, but Person entity &#8216;Otto&#8217; doesnt have a father &#8216;Ben&#8217;), or introduce an extra layer of locking over the entities (as most databases do). Note that if we inroduce locking above the entity level, our contention benefits go away, and we may be creating de-facto coarse-grain entities.</li>
</ul>
<p>Its interesting to note that the same trade-off between consistency and scalability shows up many times elsewhere &#8211; <a href="http://www.infoq.com/news/2008/03/ebaybase">eBay being a nice example</a>.</p>
<p><strong>Non-Global Identity</strong></p>
<p>Above, I presented Entities as having a globally unique identity. Much of the time, thats a good way to think about them, but be aware it is a simplification. In fact, identity is inherently defined relative to some scope. That scope needn&#8217;t be global.</p>
<p>Here are 3 different scopes for the entity <em>The number of people on earth at midnight on Dec 31, 1999</em>.</p>
<ol>
<li>The globally true answer that an omnipotent god might know</li>
<li>My national government&#8217;s official figure</li>
<li>My personal estimate</li>
</ol>
<p>Scopes may nest. Im still contemplating exactly how this affects the design of systems with mutable data.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=178&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2009/06/15/appropriate-use-of-mutable-data-in-object-functional-systems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
		<item>
		<title>OO/Imperative programmers: &#8216;Study Functional Programming or Be Ignorant&#8217;</title>
		<link>http://benhutchison.wordpress.com/2009/06/02/study-functional-programming-or-be-ignorant/</link>
		<comments>http://benhutchison.wordpress.com/2009/06/02/study-functional-programming-or-be-ignorant/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 03:56:34 +0000</pubDate>
		<dc:creator>benhutchison</dc:creator>
				<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://benhutchison.wordpress.com/?p=169</guid>
		<description><![CDATA[Right now, if you want to understand the state of the art in computer programming, those are your choices as I see them. Sorry to be so blunt &#8230; please don&#8217;t shoot the messenger. My awakening started when I began searching for a better Java, and found Scala. Scala had these weird (in my ignorance) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=169&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Right now, if you want to understand the state of the art in computer programming, those are your choices as I see them.</p>
<p>Sorry to be so blunt &#8230; please don&#8217;t shoot the messenger.</p>
<p>My awakening started when I began searching for a better Java, and <a href="http://benhutchison.wordpress.com/2008/07/01/retooling-for-scala/">found Scala</a>. Scala had these weird (in my  ignorance) functional features and learned Scala people often talked about Haskell. A uni friend <a href="http://www.cs.mu.oz.au/~bjpop/">Bernie Pope</a> raved about it too.</p>
<p>I took a look at Haskell. It wasn&#8217;t a pleasurable experience. Much of the code was almost incomprehensible. Half the concepts I&#8217;d never heard of before. It made me feel stupid, but actually what I was was <em>ignorant</em>.</p>
<p>I say <em>ignorant</em>, rather than <em>innocent</em>, because Haskell has been around for over a decade, and FP much longer.</p>
<p>I still struggle to read most Haskell, and I certainly can&#8217;t use it to build anything. But I am starting to get a sense of just how sophisticated it is, and a map of it&#8217;s concepts in my mind. I began by going down a rabbit-hole, and expected to find a burrow, a community of Haskelliers programming in their own unique way. Instead, bit by bit Ive realised Ive ended up in a vast cavern absolutely full of stuff I barely even knew existed.</p>
<ul>
<li><a href="http://www.haskell.org/all_about_monads/html/index.html">Monads &amp; friends</a></li>
<li><a href="http://www.haskell.org/sitewiki/images/8/85/TMR-Issue13.pdf">Typeclasses</a> (see &#8220;Typeclassopedia&#8221;, a must-read for advanced programmers, if only to appreciate what you don&#8217;t yet know <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</li>
<li>Composability (Need a good succinct web ref here, please suggest)</li>
<li><a href="http://blog.interlinked.org/tutorials/haskell_laziness.html">Laziness</a></li>
<li><a href="http://en.wikipedia.org/wiki/Higher-order_function">Higher order functions</a></li>
<li><a href="http://en.wikipedia.org/wiki/Functional_reactive_programming">Functional Reactive Programming</a></li>
<li><a href="http://www.haskell.org/haskellwiki/Software_transactional_memory">Software Transactional memory</a></li>
<li><a href="http://www.haskell.org/haskellwiki/Pointfree">Point-free style</a></li>
<li><a href="http://en.wikipedia.org/wiki/Zipper_(data_structure)">Zippers</a>, <a href="http://scienceblogs.com/goodmath/2009/05/finally_finger_trees.php">Finger Trees</a> and other <a href="http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf">Immutable Data Structures</a></li>
<li><a href="http://www.realworldhaskell.org/">Real World Haskell </a>and <a href="http://www.haskell.org/soe/">Hudak&#8217;s book</a></li>
</ul>
<p>The bit that stirs me up is that this &#8220;stuff&#8221; isn&#8217;t, repeat<em> is not</em>, Haskell-specific. Its rooted in the fabric of our reality, in our mathematics and our problem domains, and bits poke up like the tips of icebergs into mainstream OO languages, their true structure part-revealed. But rarely in the OO-world have I found such carefully abstracted and subtle techniques of programming in daily use.</p>
<p>Ideas from Haskell &amp; Functional Programming will continue to flow into the mainstream over the next couple of decades. Innovations will be trumpeted, trends identified, features debated, technologies evangelized.</p>
<p>But personally, Im too curious (and too lazy a typist) to wait that long.,</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/benhutchison.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/benhutchison.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/benhutchison.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/benhutchison.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/benhutchison.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/benhutchison.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/benhutchison.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/benhutchison.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/benhutchison.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/benhutchison.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/benhutchison.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/benhutchison.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/benhutchison.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/benhutchison.wordpress.com/169/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=benhutchison.wordpress.com&amp;blog=704887&amp;post=169&amp;subd=benhutchison&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://benhutchison.wordpress.com/2009/06/02/study-functional-programming-or-be-ignorant/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60ad8425dc87dc0d42e7f0f482ac9bdb?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=R" medium="image">
			<media:title type="html">benhutchison</media:title>
		</media:content>
	</item>
	</channel>
</rss>
