<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>It's a .NET Life &#187; .NET</title>
	<atom:link href="http://www.david-yancey.com/blog/index.php/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.david-yancey.com/blog</link>
	<description>Thoughts on .NET, Agile and beyond</description>
	<lastBuildDate>Mon, 26 Apr 2010 00:31:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Throw Away Code (aka Spike Solution)</title>
		<link>http://www.david-yancey.com/blog/index.php/2009/05/06/throw-away-code-aka-spike-solution/</link>
		<comments>http://www.david-yancey.com/blog/index.php/2009/05/06/throw-away-code-aka-spike-solution/#comments</comments>
		<pubDate>Thu, 07 May 2009 01:06:42 +0000</pubDate>
		<dc:creator>david.yancey</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.david-yancey.com/blog/index.php/2009/05/06/throw-away-code-aka-spike-solution/</guid>
		<description><![CDATA[  I’ve been talking with a few of my programmers the past few days about the concept of throw away code, asking them if they’ve heard of the concept, or if they’ve thought about implementing it on their teams.   All but one of them replied back to me with variations of “what a waste of [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>I’ve been talking with a few of my programmers the past few days about the concept of throw away code, asking them if they’ve heard of the concept, or if they’ve thought about implementing it on their teams.   All but one of them replied back to me with variations of “what a waste of time”, or “why would I want to code knowing I”m going to throw it away?”.</p>
<p><strong>Spike Solutions:</strong></p>
<p>Extreme Programming <a href="http://www.extremeprogramming.org/rules/spike.html">defines</a> spike solutions as:</p>
<blockquote><p>Create spike solutions to figure out answers to tough technical or design problems. A spike solution is a very simple program to explore potential solutions. Build a system which only addresses the problem under examination and ignore all other concerns. Most spikes are not good enough to keep, so <strong>expect to throw it away</strong>. The goal is reducing the risk of a technical problem or increase the reliability of a <a href="http://www.extremeprogramming.org/userstories.html">user story&#8217;s estimate.</a></p>
<p>When a technical difficulty threatens to hold up the system&#8217;s development put a pair of developers on the problem for a week or two and reduce the potential risk.</p></blockquote>
<p>The concept of throw away code is to practice coding to solve a technical problem, or practice implementing various design patterns / practices.  When your done practicing throw the code away and either start over, or implement what you’ve learned from the practice session.   When you’ve reached the end of your session then throw the code away and start over your next session.</p>
<p>Have a goal for each session.  Setting a goal such as learning how to implement the strategy design pattern, finding a solution for a technical / design issue, or testing out a new testing framework will help you stay focused and meet your goal.</p>
<p>Keep your practice sessions short, I like to keep them between 30min and 2hours, but never more than 2 hours.  Going past your set time for your session often times works against you and causes you to loose focus on your goal.  I’ve also experienced greater difficulty in convincing the business in approving longer session times.</p>
<p>Combining these sessions with pair programming also provides a great means for knowledge sharing with your team members. Whether you need to show a new team member your software library / framework, introduce them to TDD, or learn a new design pattern this is another good tool for you to use to help reach your goals.</p>
<p>So don’t be afraid to throw away your code.  In fact I encourage you to implement throw away coding sessions (aka spike solutions) in your team.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.david-yancey.com/blog/index.php/2009/05/06/throw-away-code-aka-spike-solution/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Code Noise Part 2!</title>
		<link>http://www.david-yancey.com/blog/index.php/2009/02/04/code-noise-part-2-2/</link>
		<comments>http://www.david-yancey.com/blog/index.php/2009/02/04/code-noise-part-2-2/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 20:48:25 +0000</pubDate>
		<dc:creator>david.yancey</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Refactoring]]></category>

		<guid isPermaLink="false">http://www.david-yancey.com/blog/?p=22</guid>
		<description><![CDATA[Last time we looked at what Code Noise was.  This time we are going to look at good practices for eliminating code noise. Clean Naming: Clean names reveal intent. Clean names reveal intent. Clean names reveal intent. The point I&#8217;m trying to get across here is that good clean names reveal intent.  So what do [...]]]></description>
			<content:encoded><![CDATA[<p>Last time we looked at what Code Noise was.  This time we are going to look at good practices for eliminating code noise.</p>
<p><strong>Clean Naming:</strong></p>
<p>Clean names reveal intent.<br />
Clean names reveal intent.<br />
Clean names reveal intent.</p>
<p>The point I&#8217;m trying to get across here is that good clean names reveal intent.  So what do I mean by this?  Names should tell what it does, why its there, and how it&#8217;s used.  You should not have to add a comment to explain what the intent is.  This applies to variables, functions, and class&#8217;s.</p>
<p>Let&#8217;s take a look at an example:  Before scrolling down to the &#8220;clean&#8221; version of this example try to determine what the intent of this code is.  After a bit of study, you will determine what the intent is.</p>
<div>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"><span style="color: #0000ff;">public</span> List&lt;int&gt; GetThem(int num1)
        {
            List&lt;int&gt; myList = <span style="color: #0000ff;">new</span> List&lt;int&gt;();
            int num2 = 2;
            int num3 = 0;
            myList.Add(num2);
            <span style="color: #0000ff;">for</span> (num2 = 3; num2 &lt;= num1; num2 += 2)
            {
                <span style="color: #0000ff;">for</span> (num2 = 3; num2%num3 != 0; num3 += 2)
                    <span style="color: #0000ff;">if</span> (num3 == num2)
                    {
                        myList.Add(num2);
                    }
            }
            <span style="color: #0000ff;">return</span> myList;
        }</pre>
</div>
<p>Now take a look at this example we can see what the intent of function and each variable.  By taking the time to use better intent revealing names we can reduce the amount of comments needed and have cleaner code.</p>
<div>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"><span style="color: #0000ff;">public</span> List&lt;<span style="color: #0000ff;">int</span>&gt; GetPrimeNumbers(<span style="color: #0000ff;">int</span> upperLimit)
        {
            List&lt;<span style="color: #0000ff;">int</span>&gt; PrimeNumbers = <span style="color: #0000ff;">new</span> List&lt;<span style="color: #0000ff;">int</span>&gt;();
            <span style="color: #0000ff;">int</span> testNumber = 2;
            <span style="color: #0000ff;">int</span> checkNumber = 0;
            PrimeNumbers.Add(testNumber);
            <span style="color: #0000ff;">for</span> (testNumber = 3; testNumber &lt;= upperLimit; testNumber += 2)
            {
                <span style="color: #0000ff;">for</span> (testNumber = 3; testNumber%checkNumber != 0; checkNumber += 2)
                    <span style="color: #0000ff;">if</span> (checkNumber == testNumber)
                    {
                        PrimeNumbers.Add(testNumber);
                    }
            }
            <span style="color: #0000ff;">return</span> PrimeNumbers;
        }</pre>
</div>
<p><strong>Exception Handling</strong></p>
<p>Tip #1:  Avoid generic exception handling.</p>
<p>Okay now before you start spamming me with comments, emails, general hatred let me explain why.</p>
<p>Generally when we catch a generic exception its to take care of “unhandled exceptions”.  While we don’t want unhandled exceptions presented to the customer we don’t want to default to using Try/Catch blocks just to handle a generic exception.  When we handle an exception we need to know what we are handling and why.</p>
<p>Tip #2:  Instead of returning error codes throw custom exceptions.</p>
<p>Checking return codes for errors can cause unnecessary code noise .  Instead throw a custom exception and catch that exception instead.</p>
<p>Tip #3:  Wrap 3rd party COT&#8217;s exception handling in a local custom exception class.</p>
<p>Most 3rd party COT&#8217;s exceptions are meaningless to our applications.  It would be better to catch those exceptions together in a local class and throw more meaningful exceptions.</p>
<p>These are just a few areas to look at when coding to help ensure clean code.</p>
<p>Have fun.</p>
<p>David Yancey</p>
]]></content:encoded>
			<wfw:commentRss>http://www.david-yancey.com/blog/index.php/2009/02/04/code-noise-part-2-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile and the .NET Community</title>
		<link>http://www.david-yancey.com/blog/index.php/2008/11/19/agile-and-the-net-community/</link>
		<comments>http://www.david-yancey.com/blog/index.php/2008/11/19/agile-and-the-net-community/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 05:08:18 +0000</pubDate>
		<dc:creator>david.yancey</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://www.david-yancey.com/blog/index.php/2008/11/19/agile-and-the-net-community/</guid>
		<description><![CDATA[Why does it seem that the .NET Community isn&#8217;t very active in the Agile community?  I know that there are Agile practitioners in various .NET shops however, it seems that the overall representation is very minimal.  Is it because of a lack of understanding of the Agile methodologies? Or is there a lack of support [...]]]></description>
			<content:encoded><![CDATA[<p>Why does it seem that the .NET Community isn&#8217;t very active in the Agile community?  I know that there are Agile practitioners in various .NET shops however, it seems that the overall representation is very minimal.  Is it because of a lack of understanding of the Agile methodologies? Or is there a lack of support and resources for the .NET community when it comes to Agile practices?</p>
<p>I just got back from the <a href="http://www.sqe.com/agiledevpractices/">Agile Development Practices</a> by <a href="http://www.sqe.com">SQE</a> and I felt like I was in the minority there.  As I went from sessions on TDD to Design Patterns to Refactoring each time it was asked what platform each of the developers were on I was one of 2 or 3 that mentioned .NET.  The majority was Java with a small representation of Ruby developers, which on one hand I&#8217;m glad because I got a great exposure to Java and Ruby, however on the other hand it raises the questions as to why.</p>
<p>So what is Agile?</p>
<p><a href="http://www.agilemanifesto.org/">Agile Manifesto</a>:</p>
<blockquote><p><strong>Individuals and interactions</strong> over processes and tools<br />
<strong>Working software</strong> over comprehensive documentation<br />
<strong>Customer collaboration</strong> over contract negotiation<br />
<strong>Responding to change</strong> over following a plan</p>
<p>That is, while there is value in the items on<br />
the right, we value the items on the left more.</p></blockquote>
<p>Looking at the <a href="http://www.agilemanifesto.org/principles.html">principles behind the manifesto</a> we see more of what really is the driving force of the Agile movement and begin to understand why it is important to all developers to grasp this concept.</p>
<blockquote>
<ol>
<li>Our highest priority is to <strong>satisfy the customer</strong><br />
through <strong>early and continuous delivery</strong><br />
of valuable software.</li>
<li><strong>Welcome changing requirements</strong>, even late in<br />
development. Agile processes harness change for<br />
the <strong>customer&#8217;s competitive advantage</strong>.</li>
<li><strong>Deliver working software frequently</strong>, from a<br />
couple of weeks to a couple of months, with a<br />
preference to the shorter timescale.</li>
<li><strong>Business people and developers must work<br />
together</strong> daily throughout the project.</li>
<li><strong>Build projects around motivated individuals</strong>.<br />
Give them the environment and support they need,<br />
and trust them to get the job done.</li>
<li>The most efficient and effective method of<br />
conveying information to and within a development<br />
team is <strong>face-to-face conversation.</strong></li>
<li><strong>Working software is the primary measure of progress.</strong></li>
<li>Agile processes <strong>promote sustainable development</strong>.<br />
The sponsors, developers, and users should be able<br />
to maintain a constant pace indefinitely.</li>
<li><strong>Continuous attention to technical excellence<br />
and good design</strong> enhances agility.</li>
<li><strong>Simplicity</strong>&#8211;the art of maximizing the amount<br />
of work not done&#8211;is essential.</li>
<li>The best architectures, requirements, and designs<br />
emerge from<strong> self-organizing teams</strong>.</li>
<li>At regular intervals, the <strong>team reflects</strong> on how<br />
to become more effective, then tunes and adjusts<br />
its behavior accordingly.</li>
</ol>
</blockquote>
<p>The early continuous delivery of quality working software through continuous attention to simplicity, technical excellence, good design where the business and developers form a team to work together frequently reflecting how to become more effective through self organization.</p>
<p>This is just the beginning however, Agile goes beyond just what is stated in the manifesto.  There are methodologies for all aspects of the business, from the executives with <a href="http://www.poppendieck.com/">LEAN</a>, to the team with <a href="http://www.controlchaos.com/">SCRUM</a> down to the individual developers with <a href="http://www.extremeprogramming.org/rules.html">XP (Extreme Programming).</a>  Some of the concepts with in XP will be quite familiar to the .NET community, such as Test Driven Development (TDD) and Pair Programming. </p>
<p>I want to encourage all developers to really look into what Agile has to offer and then take it to your business and challenge them to implement Agile as your new methodology.  If you are already doing Agile then start speaking up about it.  Make your presence known and help evangelize Agile in the .NET community.</p>
<p> </p>
<p>David Yancey</p>
]]></content:encoded>
			<wfw:commentRss>http://www.david-yancey.com/blog/index.php/2008/11/19/agile-and-the-net-community/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
