<?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>Journey to the Centre of the Present Moment</title>
	<atom:link href="http://nrobinson.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nrobinson.wordpress.com</link>
	<description>Thinking deeper about the things that matter.</description>
	<lastBuildDate>Tue, 22 Dec 2009 02:46:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nrobinson.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Journey to the Centre of the Present Moment</title>
		<link>http://nrobinson.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nrobinson.wordpress.com/osd.xml" title="Journey to the Centre of the Present Moment" />
	<atom:link rel='hub' href='http://nrobinson.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Flow</title>
		<link>http://nrobinson.wordpress.com/2009/12/22/flow/</link>
		<comments>http://nrobinson.wordpress.com/2009/12/22/flow/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 02:46:56 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Gamma]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/?p=46</guid>
		<description><![CDATA[I dont know what it was that first attracted me to the agile movement, but there has been many occasion when I have felt like there was something beyond the immediate, tangible aspects of the fruits of the practice that beckoned me, something deeper.  A good few years on, I realize that what makes agile <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=46&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I dont know what it was that first attracted me to the agile movement, but there has been many occasion when I have felt like there was something beyond the immediate, tangible aspects of the fruits of the practice that beckoned me, something deeper.  A good few years on, I realize that what makes agile development work, as cliche as it might seem, is its harmony with the laws of life itself.  It works because it embraces change, and at the heart of change is the unrelenting movement of impermanence.  Most software project neurosis stems from a failure to understand this law &#8211; they fight to create fixtures that become edifices of a deeper misunderstanding about life itself &#8211; that things must and can remain.  The only thing that must and can remain is the truth that nothing remains the same.  So it is that any endeavour that holds close to its heart the universal practice of flowing with the ever changing, ever unfolding of reality, is one that will succeed.  To say &#8220;its Agile&#8221;, so far down the history of the whole movement, is to miss the very point that is its essence &#8211; theres no such thingas Agile.</p>
<p>All there is is letting go, allowing and embracing change as a natural process of the universe, and aligning with the underlying forces, rather than fighting them in the interminable endeavour of the ego to make things concrete.  Nothing remains the same, not even those grandiose ideas created by our own greatness &#8211; they fade away as the rolling waves of time erode their existence into the depths of history.  To remain fixed on our ideas, on our decisions that are the beacons of our greatness in the workplace, is to simply create  coffins out of empty vessels of once interesting ideas.</p>
<p>As 2009 nears its end, I hope the future involves less about the past and more about making the best decisions to allow change to arise from the present moment based on facts as they present themselves Now.  Old ideas about what should work will be replaced with feedback from experience, to help guide decisions on what needs to change, be it process, communication, software development or anything else for that matter.  Its all the same nothingness in the end.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=46&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2009/12/22/flow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
		<item>
		<title>Resharper and Generics (or not)</title>
		<link>http://nrobinson.wordpress.com/2009/04/06/resharper-and-generics-or-not/</link>
		<comments>http://nrobinson.wordpress.com/2009/04/06/resharper-and-generics-or-not/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 14:56:26 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Beta]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/?p=43</guid>
		<description><![CDATA[I am finding quite a few issues with Resharper the more I lean on it.  Despite the issue of having to use Process Explorer to close my VS session when a bug occurs, there are other features that seem to be missing.  One thats been bugging me for some time is the inability for Resharper <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=43&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am finding quite a few issues with Resharper the more I lean on it.  Despite the issue of having to use Process Explorer to close my VS session when a bug occurs, there are other features that seem to be missing.  One thats been bugging me for some time is the inability for Resharper to help resolve a type if I declare a variable and specify it as a closed-type generic, when in fact the class isnt generic at all.  My scenario goes like this:</p>
<ol>
<li>I add a few assembly dependencies  to my project.</li>
<li>I then think I have remembered a class I am wanting to use and declare it, such as FooBar&lt;double&gt;.</li>
<li>Resharper turns FooBar red, which implies the class name isnt known.</li>
<li>Problem is FooBar does exist in one of the assemblies that was added, but its not a generic.  Resharper reports: Cannot resolve symbol: FooBar.</li>
</ol>
<p>To solve this I have to do Ctrl-N and look up the classname either in the browser (since I added assembly dependencies and not project dependencies, which would give me code-access), and then work out its not a generic.  While it doesnt take long to realise my error, I still expect resharper to offer to declare my variable as FooBar without the generic as one of its options that it provides to fix the problem.  As a productivity tool, this little feature would be very helpful.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=43&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2009/04/06/resharper-and-generics-or-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
		<item>
		<title>Theres Method in the Madness</title>
		<link>http://nrobinson.wordpress.com/2007/12/24/theres-method-in-the-madness/</link>
		<comments>http://nrobinson.wordpress.com/2007/12/24/theres-method-in-the-madness/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 11:41:43 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Beta]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/12/24/theres-method-in-the-madness/</guid>
		<description><![CDATA[I once read theres no such thing as no communication.  One might not respond to something, but that response itself is communicating something.  Every act, be it to frown, to say something, to close your eyes, or to say nothing, is communicating something at some level.  This is very important. So consider this.  Process is <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=40&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I once read theres no such thing as <em>no </em>communication.  One might not respond to something, but that response itself is communicating something.  Every act, be it to frown, to say something, to close your eyes, or to say nothing, is communicating something at some level.  This is very important.</p>
<p>So consider this.  Process is a dirty word.  So you and your team <em>dont do process.  </em>This is fine, and not uncommon by any means in certain industries.  But theres not such thing as <em>no</em> process.  Every act employed to bring software together, be it feature definition, bug tracking, testing, quality assuring, how these are done and when, is process at some level.  This is very important.</p>
<p>I think it is important to be aware of this, because it opens up the landscape of possibility and choices in evolving the way a team works and improves over time.  Metaphor lost its importance in the later version of XP, but there are people that believe strongly in its use, myself included, <a href="http://csdl2.computer.org/persagen/DLAbsToc.jsp?resourcePath=/dl/proceedings/&amp;toc=comp/proceedings/adc/2005/2487/00/2487toc.xml&amp;DOI=10.1109/ADC.2005.34" title="David West on Metaphor">see here</a>.  With metaphor our mental vocabulary is enriched, and a deeper understanding of the world can result.  And choice arises from the deeper understanding gained from employing new mental models.  If the number of choices increase, then hopefully the ability to have <em>the answer</em> increases.</p>
<p>The problem I see with the no process approach, is that it immediately shuts down a world of choice that exists that is tried and tested, and seen to lead to more successful projects.  All of this is lost, replaced by ad-hoc bespoking by teams that dont do process.  There will be meetings to ensure no or little process is introduced, yet its all process.  And if its all process, is it not better to choose from those that have a pedigree of success behind them? To spend time manufacturing a new approach to requirements gathering is ok if you are a process expert.  If you&#8217;re not a process expert then such time should be spent doing other things where true value can be added.</p>
<p>If process is a dirty word for your team, realize this habitual mental model may be inhibiting the chances of greater success.  There is not such thing as no process.  So choose the process elements you want to re-invent carefully, and for the rest, employ tried and tested principles that have been perfected so that you can get down to the real work of delivering software.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=40&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/12/24/theres-method-in-the-madness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
		<item>
		<title>Looking at Arrays and Lists</title>
		<link>http://nrobinson.wordpress.com/2007/07/07/looking-at-arrays-and-lists/</link>
		<comments>http://nrobinson.wordpress.com/2007/07/07/looking-at-arrays-and-lists/#comments</comments>
		<pubDate>Sat, 07 Jul 2007 16:19:04 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Beta]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/07/07/looking-at-arrays-and-lists/</guid>
		<description><![CDATA[Most of this ramble relates to .Net 2.0/C#. To build or enhance a high performance managed application has a set of constraints, three of which are data structure choice, algorithm choice and the garbage collection envelope. An interesting discussion arises when talking about Array vs List&#60;T&#62;, but this can be quickly addressed by understanding the <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=24&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Most of this ramble relates to .Net 2.0/C#.<span> </span></p>
<p class="MsoNormal">To build or enhance a high performance managed application has a set of constraints, three of which are data structure choice, algorithm choice and the garbage collection envelope.<span> </span>An interesting discussion arises when talking about Array vs List&lt;T&gt;, but this can be quickly addressed by understanding the mechanics of both and where they differ.<span> </span>I use List&lt;T&gt; as the comparator simply because this is the common replacement of choice by most C# programmers I have come across.</p>
<p class="MsoNormal"><span id="more-24"></span>Some think data locality is not so important in a managed host environment and you can ignore it, and largely you can, but data locality is just as important as any other axis when building a high performance application.<span> </span>The simple question is, does a poor data locality eat into CPU cycles? Yes.<span> </span>Then it requires just as much respect as choosing a poor algorithm.<span> </span>Data locality is so important there is research into enhancing the garbage collector so that it improves locality of reference as part of its role.<span> </span>So with that said, an array becomes a very good choice because its allocation creates a contiguous block of memory together in one place.<span> </span>To work with an array structure in our programs results in the complete block of memory being brought into the cache pipeline (caveats ignored).<span> </span></p>
<p class="MsoNormal">So an array is created and stored contiguously in memory.<span> </span>From this point on you will get the fastest type of performance you can expect, because an index into the data structure is a direct address (as good as can be in a managed world), and this gives you O(1) access time anywhere in the structure.<span> </span>Furthermore, arrays are a fundamental type in IL, meaning their implementation is as raw as you can get it, with minimal levels of indirection.</p>
<p class="MsoNormal">Consider:</p>
<p style="font-family:courier new;">int[] a = new int[100];<br />
a[0] = 0&#215;10;</p>
<p class="Code">Disassembly:</p>
<p class="Code"><a href="http://nrobinson.files.wordpress.com/2007/07/l1.gif" title="Listing 1"><img src="http://nrobinson.files.wordpress.com/2007/07/l1.gif?w=510" alt="Listing 1" /></a></p>
<p class="MsoNormal">At memory location <span style="font-size:8pt;color:gray;line-height:115%;font-family:'Courier New';">0x013B1BF4 </span>in my debugger I see the following:</p>
<p class="Code"><a href="http://nrobinson.files.wordpress.com/2007/07/l2.gif" title="Listing 2"><img src="http://nrobinson.files.wordpress.com/2007/07/l2.gif?w=510" alt="Listing 2" /></a></p>
<p class="MsoNormal">We are basically looking at the heap, and the first red value of 0x791240f0 is the type pointer, followed by the size of the array (64h == 100 denary).<span> </span>On assembly line 0&#215;00000031 0&#215;10 is assigned to the first element, which results in the following changes:</p>
<p><a href="http://nrobinson.files.wordpress.com/2007/07/l3.gif" title="Listing 3"><img src="http://nrobinson.files.wordpress.com/2007/07/l3.gif?w=510" alt="Listing 3" /></a></p>
<p class="MsoNormal">So the resulting JIT compiled code is as direct as you could get it with an array, and the memory is all kept together as shown above, which results in performance and perfect data locality for value types.<span> </span>Note, an array of reference types requires some extra care to ensure a better locality of reference which you don’t get for free as you do with value types.</p>
<p class="MsoNormal">The issue that arises with arrays is that they are fixed &#8211; once created, thats it. To resize and array involves scrapping the current block of memory and requesting another. There may be performance improvements provided by the CLR, but largely this means discarding the original array to be garbage collected and requesting a new block of memory.</p>
<p class="MsoNormal"><a href="http://nrobinson.files.wordpress.com/2007/07/fig11.jpg" title="Figure 1"><img src="http://nrobinson.files.wordpress.com/2007/07/fig11.jpg?w=510" alt="Figure 1" /></a></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Above the array a is created on the heap.<span> </span>Creating a new array will result in this being lost:</p>
<p><a href="http://nrobinson.files.wordpress.com/2007/07/fig2.jpg" title="Figure 2"><img src="http://nrobinson.files.wordpress.com/2007/07/fig2.jpg?w=510" alt="Figure 2" /></a></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">The difference in the location of the arrays would occur if in between creating the first array of 100 and the second of 200, more memory was allocated on the heap.<span> </span>For your information, if this were a non-managed situation and you had much more control over memory, you could re-establish the 200 element array at the original address of a, avoiding fragmentation.<span> </span>But in a managed world creating a new array and assigning it to an existing array will not allow the GC to release the memory (the 100 element array), since this will only occur at some non-predetermined time.</p>
<p class="MsoNormal"><a href="http://nrobinson.files.wordpress.com/2007/07/fig3.jpg" title="Figure 3"><img src="http://nrobinson.files.wordpress.com/2007/07/fig3.jpg?w=510" alt="Figure 3" /></a></p>
<p>For those not interested in the details you can skip this next piece.</p>
<p><a href="http://nrobinson.files.wordpress.com/2007/07/l4.gif" title="Listing 4"><img src="http://nrobinson.files.wordpress.com/2007/07/l4.gif?w=510" alt="Listing 4" /></a></p>
<p class="MsoNormal">The red text marks where the previous instance of a was (a = 100), and the blue text marks where the new array of 200 elements was created, showing how the GC does indeed allocate memory contiguously.<span> </span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">So if the size of an array needs to change, should we use an array, or should we choose a different data structure such as List&lt;T&gt;?</p>
<p class="MsoNormal">Consider this:</p>
<p class="Code">int[] intArray = new int[100];</p>
<p class="Code">List&lt;int&gt; intList = new List&lt;int&gt;();</p>
<p class="Code">The different between the two is that to get something into box structures is programmatically different, since its a direct memory address with the array, but it requires at least a first call to Add() for the list. With the array we can immediately do something like intArray[99] = 99, but for the list you would need to call Add() x100 before being able to achieve the same. You&#8217;d be forgiven for thinking you could do this:</p>
<p class="Code">List&lt;int&gt; intList = new List&lt;int&gt;(100);</p>
<p class="Code">intList[99] = 99;</p>
<p class="Code">The Capacity of a List is simply a statement to the implementation that the initial capacity will be 100, and from there after will double its capacity once exceeded. So if you add 101 items into the list its capacity will immediately become 200, add 201, and the capacity would increase to 400. If you understood a little more about how the List is implemented you might get frustrated with why the above doesnt work, but there is a very good reason why it doesnt.</p>
<p class="Code">While I am going to look at the internals of List from this point, let it be said that good engineering is about abstraction and encapsulation, and relying on implementation details is a form of very bad coupling. At the same time it is important to understand how something works, especially in a managed environment that comes with the price of the garbage collector.</p>
<p class="Code">So the reason you cant immediately gain access to the 100th element in the list is because the Capacity of a List is not th same as its Count. You cant grumble at that. Internally List is implemented using an Array&lt;T&gt;. When you add the first element, a block of memory will be created the size of Capacity. If you create the list without a size for Capacity, your default array size will be 4 in .Net 2.0.</p>
<p class="Code">The interesting stuff in List happens when you call Add:</p>
<table width="100%" cellPadding="0" cellSpacing="0" style="margin-bottom:0;">
<tr>
<td colSpan="2" vAlign="top" style="padding:4px 5px;">
<pre><font color="#1000a0">public</font> <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void" title="System.Void">void</a> <strong><a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3E/Add%28%3C%210%3E%29" class="bold">Add</a></strong>(<a title="T // Generic Argument">T</a> item)
{
    <font color="#1000a0">if</font> (<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_size:Int32" title="int System.Collections.Generic.List&lt;T&gt;._size;">_size</a> == <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array/property:Length:Int32" title="int System.Array.Length { ... }">Length</a>)
    {
        <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3E/EnsureCapacity%28Int32%29" title="void System.Collections.Generic.List&lt;T&gt;.EnsureCapacity(int);">EnsureCapacity</a>(<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_size:Int32" title="int System.Collections.Generic.List&lt;T&gt;._size;">_size</a> + <font color="#800000">1</font>);
    }
    <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>[<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_size:Int32" title="int System.Collections.Generic.List&lt;T&gt;._size;">_size</a>++] = <a title="T item; // Parameter">item</a>;
    <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_version:Int32" title="int System.Collections.Generic.List&lt;T&gt;._version;">_version</a>++;
}</pre>
</td>
</tr>
</table>
<p class="Code">&nbsp;</p>
<p class="Code">&nbsp;</p>
<p class="Code">&nbsp;</p>
<p class="Code">&nbsp;</p>
<p>If the current size has reached Capacity, the first thing to happen is to create a new array inside EnsureCapacity:</p>
<table width="100%" cellPadding="0" cellSpacing="0" style="margin-bottom:0;">
<tr>
<td colSpan="2" vAlign="top" style="padding:4px 5px;">
<pre><font color="#1000a0">private</font> <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void" title="System.Void">void</a> <strong><a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3E/EnsureCapacity%28Int32%29" class="bold">EnsureCapacity</a></strong>(<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Int32" title="System.Int32">int</a> min)
{
    <font color="#1000a0">if</font> (<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array/property:Length:Int32" title="int System.Array.Length { ... }">Length</a> &lt; <a title="int min; // Parameter">min</a>)
    {
        <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Int32" title="System.Int32">int</a> <strong>num</strong> = (<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array/property:Length:Int32" title="int System.Array.Length { ... }">Length</a> == <font color="#800000">0</font>) ? <font color="#800000">4</font> : (<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array/property:Length:Int32" title="int System.Array.Length { ... }">Length</a> * <font color="#800000">2</font>);
        <font color="#1000a0">if</font> (<a title="int num // Local Variable">num</a> &lt; <a title="int min; // Parameter">min</a>)
        {
            <a title="int num // Local Variable">num</a> = <a title="int min; // Parameter">min</a>;
        }
        <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/property:Capacity:Int32" title="int System.Collections.Generic.List&lt;T&gt;.Capacity { ... }">Capacity</a> = <a title="int num // Local Variable">num</a>;
    }
}</pre>
</td>
</tr>
</table>
<p>This private method deals with working out the next size to expand the array to &#8211; notice this._items.Length * 2. The Capacity assignment is where the re-allocation occurs:</p>
<pre><font color="#1000a0">public</font> <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Int32" title="System.Int32">int</a> <strong><a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3E/property:Capacity:Int32" class="bold">Capacity</a></strong>
{
    <font color="#1000a0">get</font>
    {
        <font color="#1000a0">return</font> <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array/property:Length:Int32" title="int System.Array.Length { ... }">Length</a>;
    }
    <font color="#1000a0">set</font>
    {
        <font color="#1000a0">if</font> (<font color="#1000a0">value</font> != <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array/property:Length:Int32" title="int System.Array.Length { ... }">Length</a>)
        {
            <font color="#1000a0">if</font> (<font color="#1000a0">value</font> &lt; <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_size:Int32" title="int System.Collections.Generic.List&lt;T&gt;._size;">_size</a>)
            {
                <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ThrowHelper" title="System.ThrowHelper">ThrowHelper</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ThrowHelper/ThrowArgumentOutOfRangeException%28System.ExceptionArgument,System.ExceptionResource%29" title="void System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource);">ThrowArgumentOutOfRangeException</a>(<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ExceptionArgument" title="System.ExceptionArgument">ExceptionArgument</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ExceptionArgument/value" title="ExceptionArgument System.ExceptionArgument.value;">value</a>, <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ExceptionResource" title="System.ExceptionResource">ExceptionResource</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.ExceptionResource/ArgumentOutOfRange_SmallCapacity" title="ExceptionResource System.ExceptionResource.ArgumentOutOfRange_SmallCapacity;">ArgumentOutOfRange_SmallCapacity</a>);
            }
            <font color="#1000a0">if</font> (<font color="#1000a0">value</font> &gt; <font color="#800000">0</font>)
            {
                <a title="T // Generic Argument">T</a>[] <strong>destinationArray</strong> = <font color="#1000a0">new</font> <a title="T // Generic Argument">T</a>[<font color="#1000a0">value</font>];
                <font color="#1000a0">if</font> (<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_size:Int32" title="int System.Collections.Generic.List&lt;T&gt;._size;">_size</a> &gt; <font color="#800000">0</font>)
                {
                    <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array" title="System.Array">Array</a>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Array/Copy%28System.Array,Int32,System.Array,Int32,Int32%29" title="void System.Array.Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length);">Copy</a>(<font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a>, <font color="#800000">0</font>, <a title="T[] destinationArray // Local Variable">destinationArray</a>, <font color="#800000">0</font>, <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_size:Int32" title="int System.Collections.Generic.List&lt;T&gt;._size;">_size</a>);
                }
                <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a> = <a title="T[] destinationArray // Local Variable">destinationArray</a>;
            }
            <font color="#1000a0">else</font>
            {
                <font color="#1000a0">this</font>.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_items:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._items;">_items</a> = <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3E" title="System.Collections.Generic.List&lt;T&gt;">List</a>&lt;<a title="T // Generic Argument">T</a>&gt;.<a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Collections.Generic.List%3C%3C%210%3E%3E/_emptyArray:%3C%210%3E%5b%5d" title="T[] System.Collections.Generic.List&lt;T&gt;._emptyArray;">_emptyArray</a>;
            }
        }
    }
}</pre>
<p>Because the List uses an Array, this means all that I said earlier about arrays is largely applicable here. The issue with a List is that even though the full array is created underneath, you are limited to reaching into the List no further than Count, which can be less than the size of the internal array (as can be seen above). There will be a performance hit with the call to Add because it does some sanity checking on the array &#8211; and potentially resizes &#8211; as well as the method call itself (<em>a List could be used in a hard realtime scenario as long as the programmer ensured the capacity was such that it obviated a resize</em>).</p>
<p>One last comment to note about the Capacity of a List. Most people know of the impact of not creating a list with a capacity, but I&#8217;ll explain it anyway. If you dont create a list with a capacity, after the first Add() your underlying array will have a size of 4. When you exceed 4 it will double to 8, then to 16, &#8230; So clearly, if you know you are going to load the list with 1250 items, you should do this : list = new List&lt;int&gt;(1250). What happens if you know your list will become 1250, but you are doing lots of async calls which means it could take some time to fill the list? Still create the list with 1250 &#8211; remember, if you decide not to create the list with a Capacity you will incur 10 memory allocations before arriving at a structure that supports your needs. If you are not in a realtime situation, you must still respect the GC, but you can be less aggressive.</p>
<p>From a class <em>role</em> perspective, both Array and List offer the same rich set of interfaces such as IList, ICollection and IEnumerable, allowing both to be interchanged with each other in your code which is useful.</p>
<p>Both List and Array are highly performant data structures, and if you use the List correctly you can achieve comparable performance to an Array. Data locality will be good with both data structures, with the same caveats when creating data structures, associative or otherwise, that cannot be established 100% inplace within the data structure &#8211; remember that if the type being stored is a reference type, all you will hold within your data structure is a reference to some place else in the heap.</p>
<p>If you know you will need to handle expansion of an array manually, dont bother reinventing the wheel and just use the List &#8211; its as fast you could probably write. The List however falls short as soon as you add another dimension to the underlyng data structure &#8211; a List is a one-dimensional concept and will offer little, unless again you opt for creating jagged array style structures. As soon as you move into the world of holding 2 or more dimensions of data, you must resort back to arrays for all the reasons already mentioned. If you need an n-dimensional structure that may need to expand, consider the algorithm for a List &#8211; you could use a lot from its implementation in creating an expandable 2D matrix.</p>
<p>6c 00 61 00 74 00 65 00 72 00 7a 00 2e.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=24&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/07/07/looking-at-arrays-and-lists/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/07/l1.gif" medium="image">
			<media:title type="html">Listing 1</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/07/l2.gif" medium="image">
			<media:title type="html">Listing 2</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/07/l3.gif" medium="image">
			<media:title type="html">Listing 3</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/07/fig11.jpg" medium="image">
			<media:title type="html">Figure 1</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/07/fig2.jpg" medium="image">
			<media:title type="html">Figure 2</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/07/fig3.jpg" medium="image">
			<media:title type="html">Figure 3</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/07/l4.gif" medium="image">
			<media:title type="html">Listing 4</media:title>
		</media:content>
	</item>
		<item>
		<title>Tuning your invariants</title>
		<link>http://nrobinson.wordpress.com/2007/06/17/know-your-invariants/</link>
		<comments>http://nrobinson.wordpress.com/2007/06/17/know-your-invariants/#comments</comments>
		<pubDate>Sun, 17 Jun 2007 15:34:22 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Beta]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/06/17/know-your-invariants/</guid>
		<description><![CDATA[I&#8217;m currently building a pretty complex parallel computer that presently runs across multiple nodes in-process. The idea is to push the design to work across a grid of collaborating nodes, either as separate threads, processes or networked machines. I am currently working on two key areas: Limiting the number of garbage collections that are necessary. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=22&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently building a pretty complex <a href="http://en.wikipedia.org/wiki/Parallel_computer" title="Parallel Computer Definition">parallel computer</a> that presently runs across multiple nodes in-process.  The idea is to push the design to work across a grid of collaborating nodes, either as separate threads, processes or networked machines.  I am currently working on two key areas:</p>
<ol>
<li>Limiting the number of garbage collections that are necessary.</li>
<li>Achieving high performance in the multi-threaded core engine.</li>
</ol>
<p>This week has been focused on both axis of performance, but recently I have been pushing my design to improve its scalability.  Today I have managed to get the system to run an extreme number of networking downloads with a CPU consumption envelope remaining below 3%, which is pretty impressive.  Most of this has come from harnessing IO completion ports as well as being extremely savvy with the use of threads provided by the .Net thread pool.  So far I am doing well riding on the back of the .Net thread pool, but I may need to consider dedicated threads at some point &#8211; the thread pool scheduler can thrash a little in certain scenarios, but I&#8217;m not noticing that yet.</p>
<p>Due to the nature of this system, which I&#8217;ll explain more of soon, there can be multiple active downloaders retrieving online data from n sources.  Downloaded data comes into the system and is processed via a sophisticated logical pipeline.   An earlier naive implementation resulted in a saturation of the thread pool, or a profound number of context switches due to equally primitive locking strategies.</p>
<p>To limit or reduce garbage collections I have also needed to improve the types of data structures I am using, as well as understand better the invariants I need to uphold during runtime.  For example, I have a pipeline that needs to have data live and in transit as much as possible, to utilize resources as best as can be achieved, whilst not saturating the CPU or increasing the working set pointlessly.  Processors on the pipeline work at different rates, but this means that at various points in time, there could be too much waiting in the pipeline, which stresses the memory footprint.</p>
<p>Part of the solution comes from throttling inputs to the pipeline, and using non-collectable data structures (buffers) to handle the task items waiitng to be processed.  The head of my pipeline now uses a ring buffer and a semaphore to help avoid creating thousands of network requests to fill the pipeline.  The nature of the downstream elements of the pipeline is to process large volumes of data per item, which naturally results in their execution running slower than the source of the pipeline (hence the possibility of the active objects at the source filling up the buffers and killing the memory footprint.</p>
<p>Through careful steps I have managed to produce a highly performant parallel data pipeline without incurring much resources at all. My original design worked well in every way apart from the two key areas above.  I could execute multiple concurrent searches and download and process a lot of data, but CPU utilization was around 80%.  By breaking the design down, understanding the finer low-level elements of real-time programming, I have arrived at present invariants that allow my system to download the same data as before at nearly 3x the speed, using no more than 3% CPU.  I&#8217;m still working on the GC issues, but thats not bad going.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/22/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/22/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=22&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/06/17/know-your-invariants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
		<item>
		<title>40 Hour Guideline?</title>
		<link>http://nrobinson.wordpress.com/2007/06/08/40-hour-guideline/</link>
		<comments>http://nrobinson.wordpress.com/2007/06/08/40-hour-guideline/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 20:17:28 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Beta]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/06/08/40-hour-guideline/</guid>
		<description><![CDATA[For some the notion of a 40 hour week is too difficult accept, deeming it too short to really achieve anything. But the rationale for this working principle is built on sound thinking. Working long hours at fever pitch will not only stress a team out, but will induce mental fatigue to the point that <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=21&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For some the notion of a 40 hour week is too difficult accept, deeming it too short to really achieve anything.  But the rationale for this working principle is built on sound thinking.  Working long hours at fever pitch will not only stress a team out, but will induce mental fatigue to the point that silly mistakes are made, and the team will actually work slower and do less than if they were energised everyday and doing less.  Obviously when a release is coming up or other such important deadline, then the amount of work the team does must be as flexible as possible, and working more should be acceptable.</p>
<p>I think there is something important to consider that supports the 40 hour week &#8220;guideline&#8221;.  In a team that is energized and running at full-steam, the amount of things going on at any time could be quite large, with the whole team busy coding, designing or talking. Even when a team member is working on something, they will be actively engaged in ensuring they are aware of what is going on around them while they go about their business.  Many people who truly engage with pair programming say they like it, but it can be draining.  When we work alone, it is easy to take a &#8220;breather&#8221;, to sit back a little and reflect.  But when a pair is engaged, theres no real breather to talk of &#8211; its a continual every rolling train of design ideas, forward thinking, code-reviewing and programming to carve the features into the system.  When this process hums along like a spinning top, the energy required by the participants is greater than when working alone (certainly in my experience).  This is all worthwhile because the idea is that the features that are being implemented are moving along at a productive steady pace and the quality of that work is second to none.</p>
<p>Even when pair programming is not used, there are other practices that actually support this steady train of relentless progress throughout the day, such as TDD (test driven development).  TDD as a practice and a design process can with experience become a profound tool to develop a system with, but its impact on the way its followers think and work, alone or in pairs, should be considered when reviewing the 40 hour guideline.  Just like a spinning top, TDD is difficult to get right, difficult to get it humming along.  But when it does, the level of delivery and progress can be just as profound as the practice itself, creating the well known &#8220;flow&#8221; state quite easily, and generating extended periods of high concentration and focused work &#8211; times this by at least two if this is being done with pairs.</p>
<p>Sometimes these periods of high productivity are like streaks of lightening across the sky, and the amount of progress in a working week might feel small and unproductive. Ignoring the human element that causes the daily mental, emotional and phyisical states of your workforce to fluctuate, a well running team should be able to accommodate and self-organize to help maintain its steady momentum, and the troughs should be less acute.  And this steady pace is built on the high focus developed from the XP practices and open working environment.  When things are truly rocking, it is not uncommon for me to arrive home absolutely exhausted.  But its a positive exhaustion, because its the effect of a causation that itself is positive.  I can wake up the following morning bright and early and be 100% ready for a day riding the development train, and this is part of the point behind the 40 hour guideline.  Happy people are more productive.  Being more productive further fuels happiness and well-being of the team, because they are riding on a wave of positive steady delivery.</p>
<p>The 40 hour week guideline <strong>is</strong> in the end just a guideline, and it should be appropriately changed to suite your environment.  But its a worthwhile principle of XP and other agile practices because if things are going well, progress will be steady and moving and theres no need for fever pitch.  If this isnt the case, if productivity is not as high and you&#8217;re thinking of increasing the hours to get more work out, it might be that other parts of the process arent working like they should be.  Increasing pressure to work longer hours might seem like the easiest approach, and in some cases it can be.  But there should be no need when the team has developed the steady pace.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=21&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/06/08/40-hour-guideline/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
		<item>
		<title>Applied Abstraction (part 3)</title>
		<link>http://nrobinson.wordpress.com/2007/05/17/applied-abstraction-part-3/</link>
		<comments>http://nrobinson.wordpress.com/2007/05/17/applied-abstraction-part-3/#comments</comments>
		<pubDate>Thu, 17 May 2007 19:33:05 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Beta]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/05/17/applied-abstraction-part-3/</guid>
		<description><![CDATA[Quick Review I have raised quite a few points from just a small section of code. It is clear a failure to apply abstraction well has subsequently allowed the misplacement of system responsibilities within the AssignmentForm class. The business policy details belong not on a user interface class but on a domain class or something <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=19&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h4>Quick Review</h4>
<p class="MsoNormal">I have raised quite a few points from just a small section of code.<span>  </span>It is clear a failure to apply abstraction well has subsequently allowed the misplacement of system responsibilities within the <span class="SourceCodeChar"><span style="font-size:8pt;">AssignmentForm</span></span> class.<span>  </span>The business policy details belong not on a user interface class but on a domain class or something similar.<span>  </span>The domain model has the role of representing the business domain, its relationships and its policies.<span>  </span>Centralising business logic in the domain model keeps all of the important details in one place, and it should be through abstraction that these details are exposed to the rest of the software in a way that keeps the <em>how </em>hidden behind the <em>what.</em></p>
<p class="MsoNormal"><span id="more-19"></span></p>
<p class="MsoNormal">Building object oriented software is all about constructing the system from software artefacts that are fashioned to work with the forces of change.<span>  </span>As has been mentioned, a good design axiom is to build against abstract concepts rather than concrete representations.<span>  </span>This is achieved through the use of abstract types (abstract class or interface), which are used to form the semantic substructure on which the system implementation will be written.<span>  </span>Whenever a piece of code is built against an abstract type, it is shielded from whatever may change behind that software construct.<span>  </span>New requirements are added to the system by “plugging in” to the foundations of the of the design, the substructure.<span>  </span>In our example the <span class="SourceCodeChar"><span style="font-size:8pt;">AssignmentForm</span></span> is a client, and <span class="SourceCodeChar"><span style="font-size:8pt;">Vehicle</span></span> and <span class="SourceCodeChar"><span style="font-size:8pt;">Customer</span></span> are the abstract constructs that the <span class="SourceCodeChar"><span style="font-size:8pt;">AssignmentForm</span></span> should depend upon.<span>  </span>Actual requirements are built and evolved by plugging them into these existing design elements.</p>
<p class="MsoNormal" align="center"><a href="http://nrobinson.files.wordpress.com/2007/05/figure2.gif" title="Figure 2"><img src="http://nrobinson.files.wordpress.com/2007/05/figure2.thumbnail.gif?w=510" alt="Figure 2" /></a></p>
<p class="MsoNormal" align="center">Figure 2</p>
<p class="MsoNormal" align="left">&nbsp;</p>
<p class="MsoNormal">In figure 2 <span class="SourceCodeChar"><span style="font-size:8pt;">Vehicle</span></span> and <span class="SourceCodeChar"><span style="font-size:8pt;">Customer</span></span> form the semantic bond, each an abstract type of core concepts in the problem domain.<span>  </span>Underneath these abstract types there is an ever changing world of evolving requirements being constructed and modified to plug into the abstract foundation.<span>  </span>Here the new type <span class="SourceCodeChar"><span style="font-size:8pt;">CorporateCustomer</span></span> is introduced as a specialization of the abstract <span class="SourceCodeChar"><span style="font-size:8pt;">Customer</span></span> type, and new vehicles are added to the system in exactly the same way.<span>  </span>With the client’s dependent only on abstract structures, they are oblivious to these types of modifications made to the system over time.<span>  </span>Without this type of complexity management, it would be much riskier to add new functionality to the software. <span> </span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="QuickPoint"><font color="#808000"><strong>Substructure Metaphor</strong></font></p>
<p class="QuickPoint"><font color="#808000"><em>I have found the notion of a substructure a useful metaphor to help demonstrate the importance of the abstract types within object oriented software.<span>  </span>In construction the substructure makes up the foundations on which the main structure sits.<span>  </span>The purpose of these foundations is to withstand the forces of nature, which if ignored can uproot and move the above superstructure with ease.<span>  </span>In software construction these forces are the natural evolving requirements.<span>  </span>Abstract types are like the footings and foundations that take the load of the rest of the system, and provide a structure on which the requirements can be implemented.</em></font></p>
<p class="QuickPoint"><font color="#808000"><em>This metaphor should only be used to appreciate the relevance of the internal underpinnings of the design.<span>  </span>It is wrong to apply the construction metaphor completely, because here the foundations are built first before any subsequent building can take place.<span>  </span>From a software perspective this would require a full design up-front exercise to appreciate what needs to be in the foundations.<span>  </span>However agile development principles show us that the construction metaphor falls down when taken literally, since we can build our software safely in an evolutionary manner that allows the substructure to slowly take place as the system grows.</em></font></p>
<p class="MsoNormal"> What this all boils down to is the need to code against specifications, not implementations.<span>  </span>The designer of the tracking system overlooked the <em>essence</em> of the <span class="SourceCodeChar"><span style="font-size:8pt;">Vehicle</span></span> when he modelled it in the software.<span>   </span>It seems the essence of the <span class="SourceCodeChar"><span style="font-size:8pt;">Vehicle</span></span> is that it has a property named <span class="SourceCodeChar"><span style="font-size:8pt;">Assignee</span></span> and a property named <span class="SourceCodeChar"><span style="font-size:8pt;">AssigneeName</span></span>, both poorly naming the concepts they represent.<span>  </span>The <span class="SourceCodeChar"><span style="font-size:8pt;">Vehicle</span></span> has no important role in the system but to collate some data items.<span>  </span>A change to the vehicle hiring or returning policy has a greater chance of affecting the <span class="SourceCodeChar"><span style="font-size:8pt;">AssignmentForm</span></span> than it does the <span class="SourceCodeChar"><span style="font-size:8pt;">Vehicle</span></span> class; this is clearly wrong.<span>  </span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">The obscure names chosen for the <span class="SourceCodeChar"><span style="font-size:8pt;">Vehicle</span></span> properties fail to capture the true domain, and I am certain I could not talk to the domain experts about <span class="SourceCodeChar"><span style="font-size:8pt;">Assignee</span></span>’s and <span class="SourceCodeChar"><span style="font-size:8pt;">AssigneeName</span></span>’s without there being confusion.<span>  </span>The fix is to focus on mapping the outside world correctly to the inside world of the software, and we do this with the help of the <em>ubiquitous language</em>.<span>  </span>Using a ubiquitous language it will be easier to reason about the domain while working with the code, because the domain and the code will the same.</p>
<p class="QuickPoint"><font color="#808000"><strong>Ubiquitous Language</strong></font></p>
<p class="MsoNormal"><font color="#808000">In Domain Driven Design, Eric Evans presents a technique that bridges the knowledge transfer gap between the developers and the domain experts, the ubiquitous language.<span>  </span>This language is built on collaboration with all team members to model the domain the software is being constructed for.<span>  </span>The team continually exercises the ubiquitous language, both in conversation as well as in the code. This not only improves the communication and understanding between the domain experts and software team, but its manifestation as the core domain model in the system further reinforces the focus on domain concepts, not technical concepts. </font></p>
<p>Our next objective then (in part 4) is to introduce just a little bit of abstraction to see how well it affects the design. In the next section I will take the code through a number of refactorings, and my objective will be to improve abstraction, separation of concerns, and better represent the problem domain within the code. By better capturing the <em>essence</em> of the problem I will show how the domain can be modelled in the code to improve the current readability issues.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=19&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/05/17/applied-abstraction-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>

		<media:content url="http://nrobinson.files.wordpress.com/2007/05/figure2.thumbnail.gif" medium="image">
			<media:title type="html">Figure 2</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Down!</title>
		<link>http://nrobinson.wordpress.com/2007/05/15/get-down/</link>
		<comments>http://nrobinson.wordpress.com/2007/05/15/get-down/#comments</comments>
		<pubDate>Tue, 15 May 2007 22:53:19 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Funny]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/05/15/get-down/</guid>
		<description><![CDATA[I used to know how to shake my booty &#8211; heres a family video: http://www.youtube.com/watch?v=crEz8i6oVpI. But age caught up with me &#8211; I couldnt run fast enough. However, check me out now &#8211; a little older, a few gray hairs, but I still know how to show the ladies a good time : http://www.youtube.com/watch?v=EumQLlJA1rc. Ouch<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=18&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I used to know how to shake my booty &#8211; heres a family video: <a href="http://www.youtube.com/watch?v=crEz8i6oVpI" title="Oh yah!">http://www.youtube.com/watch?v=crEz8i6oVpI</a>.</p>
<p>But age caught up with me &#8211; I couldnt run fast enough.  However, check me out now &#8211; a little older, a few gray hairs, but I still know how to show the ladies a good time :<a href="http://www.youtube.com/watch?v=EumQLlJA1rc"> http://www.youtube.com/watch?v=EumQLlJA1rc</a>.</p>
<p>Ouch.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=18&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/05/15/get-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
		<item>
		<title>Dear Future Me&#8230;</title>
		<link>http://nrobinson.wordpress.com/2007/05/15/dear-future-me/</link>
		<comments>http://nrobinson.wordpress.com/2007/05/15/dear-future-me/#comments</comments>
		<pubDate>Tue, 15 May 2007 21:57:37 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Gamma]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/05/15/dear-future-me/</guid>
		<description><![CDATA[http://www.futureme.org/index.php View the Public Entries &#8211; some weird, some stupid, some moving<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=16&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.futureme.org/index.php" title="Future Me - Please say you are a millionaire!">http://www.futureme.org/index.php</a></p>
<p>View the Public Entries &#8211; some weird, some stupid, some moving.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=16&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/05/15/dear-future-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
		<item>
		<title>Estimation Smell</title>
		<link>http://nrobinson.wordpress.com/2007/05/13/estimation-smell/</link>
		<comments>http://nrobinson.wordpress.com/2007/05/13/estimation-smell/#comments</comments>
		<pubDate>Sun, 13 May 2007 09:56:20 +0000</pubDate>
		<dc:creator>Seeker</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Beta]]></category>

		<guid isPermaLink="false">http://nrobinson.wordpress.com/2007/05/13/estimation-smell/</guid>
		<description><![CDATA[Sometimes it seems there are dependencies in user stories, and the dependency can cause confusion on how to proceed with the estimates, and like many things estimation isnt an exact science. A number of times over the past year this problem has cropped up in some form or another. One approach I like is to <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=15&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes it seems there are dependencies in user stories, and the dependency can cause confusion on how to proceed with the estimates, and like many things estimation isnt an exact science.  A number of times over the past year this problem has cropped up in some form or another.  One approach I like is to think of the stories in isolation, because it not only keeps things simpler for everybody during planning, but it also works very well with the principle of change &#8211; the customer is allowed to change priorities.</p>
<p><span id="more-15"></span> Consider the following stories:</p>
<ol>
<li>Show ticking stock prices (3 points)</li>
<li>Show ticking index prices (1 point)</li>
<li>Show ticking hedge prices (1 point)</li>
</ol>
<p>A possible way to estimate these could be to say that if we do the stock prices story first, it will take 3 points, and the rest should be much quicker, say 1.  But theres a problem with this way of estimating &#8211; what happens if the customer requests to do the hedge prices story first? To make some sense we would probably have to change the estimates on the other two dependent stories.  A second issue is that there is a smell here &#8211; if we are building just-enough-infrastructure, adhering to the 80/20 rule when building the code, we shouldnt have a &#8220;framework&#8221; at the end of the first story.  What happens if after doing the framework to allow the other two stories to be implemented much faster, the customer requests to drop the other stories for other more important work?</p>
<p>Another possible way to deal with these dependent stories could be to pull out the technical aspects, create a story for those, and then stabilise our estimates on the actual three stories above:</p>
<ol>
<li>Build ticking engine (3 points) // Technical Story</li>
<li>Show ticking stock prices (1 point)</li>
<li>Show ticking index prices (1 point)</li>
<li>Show ticking hedge prices (1 point)</li>
</ol>
<p>I wouldnt take this approach any further for the simple fact it sides-steps all of the techniques we are trying to harness to help us deliver just enough software faster.  The technical story not only has to be done first (which reduces the customers ability to prioritise based on business value), but after the technical story something could arise that would force the customer to drop the other ticking stories, leaving all of the technical &#8220;infrastructure&#8221; in place in the system.  I have never liked this approach because it completely avoids the process of emergent design that would be used to build the software incrementally around the axis of these three stories.</p>
<p>In the end the principles I like to keep in mind are:</p>
<ol>
<li>Simplicity</li>
<li>Individuality</li>
<li>Simple Design</li>
</ol>
<p><em>Simplicity -</em> keep the estimations and process of dealing with them simple.  As soon as it starts to &#8220;feel&#8221; complicated, thats probably a smell.</p>
<p><em>Individuality -</em> see work as individual pieces.</p>
<p><em>Simple Design &#8211; </em>possibly one of the hardest principles to learn, but very important to grapple and gain experience with, since it is one of the key enablers to building high-quality software fast.   In the original stories above I would see that I would need to build something to allow me to get some ticking in each of the stories.  I would be thinking how I could bring something into existence that would be as simple and as lean as possible.  This could cause me to lean towards estimating all around the same size, such as 2 or 1.5.  Not a true fan of decimal estimations I would also consider just leaving all at 2.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nrobinson.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nrobinson.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nrobinson.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nrobinson.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nrobinson.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nrobinson.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nrobinson.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nrobinson.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nrobinson.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nrobinson.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nrobinson.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nrobinson.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nrobinson.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nrobinson.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nrobinson.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nrobinson.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nrobinson.wordpress.com&amp;blog=1053052&amp;post=15&amp;subd=nrobinson&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nrobinson.wordpress.com/2007/05/13/estimation-smell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7c6356d7c122d23ecfbd5cadf23914c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Seeker</media:title>
		</media:content>
	</item>
	</channel>
</rss>
