<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>ICodeNazi</title>
	<atom:link href="http://icodenazi.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://icodenazi.wordpress.com</link>
	<description>No more bad code for you!</description>
	<lastBuildDate>Thu, 06 Nov 2008 09:02:18 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='icodenazi.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/5e85823e66bc9f8bf7be427ccef411f5?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>ICodeNazi</title>
		<link>http://icodenazi.wordpress.com</link>
	</image>
			<item>
		<title>Bad code examples (part 2)</title>
		<link>http://icodenazi.wordpress.com/2008/11/06/bad-code-examples-part-2/</link>
		<comments>http://icodenazi.wordpress.com/2008/11/06/bad-code-examples-part-2/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 08:25:05 +0000</pubDate>
		<dc:creator>noocyte</dc:creator>
				<category><![CDATA[Code quality]]></category>
		<category><![CDATA[bad code]]></category>
		<category><![CDATA[using]]></category>

		<guid isPermaLink="false">http://icodenazi.wordpress.com/2008/11/06/bad-code-examples-part-2/</guid>
		<description><![CDATA[I just came across some really bad code and I just had to post it right now. Some of the mistakes have been covered in my previous post, but what-the-heck! Here is the offending code: 

public static NameValueCollection getGlobalVariables(string keyPrefix) {

    string strConnection = Magic.GetConnectionString();

    SqlConnection sqlConnection = null;

 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=10&subd=icodenazi&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just came across some really bad code and I just had to post it right now. Some of the mistakes have been covered in my previous post, but what-the-heck! Here is the offending code: </p>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> NameValueCollection getGlobalVariables(<span style="color:#0000ff;">string</span> keyPrefix) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">string</span> strConnection = Magic.GetConnectionString();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    SqlConnection sqlConnection = <span style="color:#0000ff;">null</span>;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    NameValueCollection nvList = <span style="color:#0000ff;">new</span> NameValueCollection();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    <span style="color:#0000ff;">try</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        sqlConnection = <span style="color:#0000ff;">new</span> SqlConnection(strConnection);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        SqlCommand sqlCommand =
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">                <span style="color:#0000ff;">new</span> SqlCommand(&quot;<span style="color:#8b0000;">SELECT [something] FROM [somewhere] WHERE Name LIKE @Name</span>&quot;&quot;, sqlConnection);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        sqlCommand.Parameters.AddWithValue(&quot;<span style="color:#8b0000;">@Name</span>&quot;, keyPrefix + &quot;<span style="color:#8b0000;">%</span>&quot;);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        sqlConnection.Open();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        SqlDataReader myReader = sqlCommand.ExecuteReader();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">while</span> ( myReader.Read() )
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            nvList.Add(myReader.GetString(0), myReader.GetString(1));
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        myReader.Close();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">catch</span> ( Exception e ) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        nvList = <span style="color:#0000ff;">null</span>;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">throw</span> e;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">finally</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">if</span> ( sqlConnection != <span style="color:#0000ff;">null</span> )
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            sqlConnection.Close();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">return</span> nvList;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">}
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
</pre>
<p><p><font face="consolas" size="4"></font></p>
<p>Please note that the connection string is coming from a more or less sensible place, removed to protect the innocent&#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<p>So what&#8217;s wrong with this code? Lots! </p>
<ul>
<li>Using SqlConnection and not DbConnection is evil </li>
<li>Not applying the &quot;using&quot; pattern for connections is evil </li>
<li>try-catch-finally is evil </li>
<li>Catching &quot;Exception&quot; is evil </li>
<li>&quot;throw e&quot; is evil </li>
</ul>
<p>Just the about the only two good things about this code is the fact that it is static and it&#8217;s using parameters and not concatenated strings for the sql command. So, how would the code look if I had my way with it? Something like this I guess: </p>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> NameValueCollection GetGlobalVariables(<span style="color:#0000ff;">string</span> keyPrefix) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">using</span> ( DbConnection sqlConnection = ConnectionFactory.DefaultConnection ) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        NameValueCollection nvList = <span style="color:#0000ff;">new</span> NameValueCollection();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        DbCommand sqlCommand = sqlConnection.CreateCommand();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        sqlCommand.CommandText = &quot;<span style="color:#8b0000;">SELECT [something] FROM [somewhere] WHERE Name LIKE @Name</span>&quot;;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        DbParameter sqlParam = ParameterFactory.CreateInputParameter(&quot;<span style="color:#8b0000;">Name</span>&quot;, keyPrefix + &quot;<span style="color:#8b0000;">%</span>&quot;);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        sqlCommand.Parameters.Add(sqlParam);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        sqlConnection.Open();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">using</span> ( DbDataReader reader = sqlCommand.ExecuteReader() ) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            <span style="color:#0000ff;">while</span> ( reader.Read() )
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">                nvList.Add(reader.GetString(0), reader.GetString(1));
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">return</span> nvList;
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">}</pre>
</pre>
<p>That’s my 2 cents anyway… I’m sure that are other optimizations that can be done as well, please post any suggestions in the comments section.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/icodenazi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/icodenazi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/icodenazi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/icodenazi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/icodenazi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/icodenazi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/icodenazi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/icodenazi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/icodenazi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/icodenazi.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=10&subd=icodenazi&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://icodenazi.wordpress.com/2008/11/06/bad-code-examples-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fce6388ae17f02a65fb3e9765be73d25?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noocyte</media:title>
		</media:content>
	</item>
		<item>
		<title>StyleCop &#8211; Clearing up confusion</title>
		<link>http://icodenazi.wordpress.com/2008/07/21/stylecop-clearing-up-confusion/</link>
		<comments>http://icodenazi.wordpress.com/2008/07/21/stylecop-clearing-up-confusion/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 08:26:26 +0000</pubDate>
		<dc:creator>noocyte</dc:creator>
				<category><![CDATA[Code quality]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[stylecop]]></category>

		<guid isPermaLink="false">http://icodenazi.wordpress.com/2008/07/21/stylecop-clearing-up-confusion/</guid>
		<description><![CDATA[bharry&#8217;s WebLog : Clearing up confusion
We found that StyleCop is, in fact, a very useful tool and it does things FxCop and TeamDev doesn&#8217;t do (and it doesn&#8217;t do the things they do).  It is a wonderful complementary tool.  StyleCop is a tool for doing coding style checking to verify that source code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=8&subd=icodenazi&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://blogs.msdn.com/bharry/archive/2008/07/19/clearing-up-confusion.aspx">bharry&#8217;s WebLog : Clearing up confusion</a></p>
<blockquote><p>We found that StyleCop is, in fact, a very useful tool and it does things FxCop and TeamDev doesn&#8217;t do (and it doesn&#8217;t do the things they do).  It is a wonderful complementary tool.  StyleCop is a tool for doing coding style checking to verify that source code is formatted the way you want and follows the style guidelines for conventions.  While there is some overlap with FxCop (like checking identifier capitalization), the overlap is miniscule as StyleCop does not do the deep analysis that the other static analysis tools do to enable code correctness checks, security checks, etc.</p></blockquote>
<p>Good. I think this should be part of VSTS/VS in the future. Automate, automate, automate!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/icodenazi.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/icodenazi.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/icodenazi.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/icodenazi.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/icodenazi.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/icodenazi.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/icodenazi.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/icodenazi.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/icodenazi.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/icodenazi.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/icodenazi.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/icodenazi.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=8&subd=icodenazi&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://icodenazi.wordpress.com/2008/07/21/stylecop-clearing-up-confusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fce6388ae17f02a65fb3e9765be73d25?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noocyte</media:title>
		</media:content>
	</item>
		<item>
		<title>Spartan Programming</title>
		<link>http://icodenazi.wordpress.com/2008/07/08/spartan-programming/</link>
		<comments>http://icodenazi.wordpress.com/2008/07/08/spartan-programming/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 14:18:07 +0000</pubDate>
		<dc:creator>noocyte</dc:creator>
				<category><![CDATA[Refactor]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[spartan programming]]></category>

		<guid isPermaLink="false">http://icodenazi.wordpress.com/2008/07/08/spartan-programming/</guid>
		<description><![CDATA[Coding Horror: Spartan Programming
Minimalism isn&#8217;t always the right choice, but it&#8217;s rarely the wrong choice. You could certainly do worse than to adopt the discipline of spartan programming on your next programming project. 
You could a lot worse than listening when Jeff talks&#8230; And I pretty much agree with him on Spartan Programming. I like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=7&subd=icodenazi&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.codinghorror.com/blog/archives/001148.html">Coding Horror: Spartan Programming</a><br />
<blockquote>Minimalism isn&#8217;t always the right choice, but it&#8217;s rarely the wrong choice. You could certainly do worse than to adopt the discipline of spartan programming on your next programming project. </p></blockquote>
<p>You could a lot worse than listening when Jeff talks&#8230; And I pretty much agree with him on Spartan Programming. I like my code short and sweet, but some of the ideas are just too much. renaming variables from &#8220;msg&#8221; to &#8220;m&#8221; doesn&#8217;t really make the code any better, it just makes it a little bit harder to realize that &#8220;m&#8221; was the e-mail message. &#8220;msg&#8221; on the other hand makes it just a little bit easier to remember&#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/icodenazi.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/icodenazi.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/icodenazi.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/icodenazi.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/icodenazi.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/icodenazi.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/icodenazi.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/icodenazi.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/icodenazi.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/icodenazi.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/icodenazi.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/icodenazi.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=7&subd=icodenazi&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://icodenazi.wordpress.com/2008/07/08/spartan-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fce6388ae17f02a65fb3e9765be73d25?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noocyte</media:title>
		</media:content>
	</item>
		<item>
		<title>Pex &#8211; Automated Exploratory Testing for .NET</title>
		<link>http://icodenazi.wordpress.com/2008/07/04/pex-automated-exploratory-testing-for-net/</link>
		<comments>http://icodenazi.wordpress.com/2008/07/04/pex-automated-exploratory-testing-for-net/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 07:52:10 +0000</pubDate>
		<dc:creator>noocyte</dc:creator>
				<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[pex]]></category>

		<guid isPermaLink="false">http://icodenazi.wordpress.com/2008/07/04/pex-automated-exploratory-testing-for-net/</guid>
		<description><![CDATA[Pex &#8211; Automated Exploratory Testing for .NET &#124; briankel &#124; Channel 9
Pex is a tool being developed by Microsoft Research which has the potential to dramatically improve the quality of software testing while requiring minimal, if any, effort on the part of the developer. Pex can automatically generate a set of inputs for a paramaterized [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=6&subd=icodenazi&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://channel9.msdn.com/posts/briankel/Pex-Automated-Exploratory-Testing-for-NET/">Pex &#8211; Automated Exploratory Testing for .NET | briankel | Channel 9</a></p>
<blockquote><p>Pex is a tool being developed by Microsoft Research which has the potential to dramatically improve the quality of software testing while requiring minimal, if any, effort on the part of the developer. Pex can automatically generate a set of inputs for a paramaterized unit test which can effectively excercise most, if not all, possible code paths.
</p></blockquote>
<p>Pex is cool! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m doing some testing on it myself, but the warm weather is stopping me from working really hard on it&#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/icodenazi.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/icodenazi.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/icodenazi.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/icodenazi.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/icodenazi.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/icodenazi.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/icodenazi.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/icodenazi.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/icodenazi.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/icodenazi.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/icodenazi.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/icodenazi.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=6&subd=icodenazi&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://icodenazi.wordpress.com/2008/07/04/pex-automated-exploratory-testing-for-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fce6388ae17f02a65fb3e9765be73d25?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noocyte</media:title>
		</media:content>
	</item>
		<item>
		<title>Bad code examples (part 1)</title>
		<link>http://icodenazi.wordpress.com/2008/06/10/bad-code-examples-part-1/</link>
		<comments>http://icodenazi.wordpress.com/2008/06/10/bad-code-examples-part-1/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 13:36:30 +0000</pubDate>
		<dc:creator>noocyte</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bad code]]></category>

		<guid isPermaLink="false">http://icodenazi.wordpress.com/?p=4</guid>
		<description><![CDATA[So, I&#8217;ve been looking through some old code today and I&#8217;ve found some pretty good examples of how to not write good code. Take a look:


   1: public class MapHelper {
   2:     public MapHelper() {
   3:     }
   4:&#160; 
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=4&subd=icodenazi&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So, I&#8217;ve been looking through some old code today and I&#8217;ve found some pretty good examples of how to not write good code. Take a look:</p>
<div style="border-right:gray 1px solid;border-top:gray 1px solid;font-size:8pt;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;border-bottom:gray 1px solid;font-family:consolas, &#39;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MapHelper {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>     <span style="color:#0000ff;">public</span> MapHelper() {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>&#160; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> String BooleanValue(<span style="color:#0000ff;">bool</span> val) {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>         <span style="color:#0000ff;">if</span> (val) <span style="color:#0000ff;">return</span> Boolean.TrueString.ToLower();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>         <span style="color:#0000ff;">else</span> <span style="color:#0000ff;">return</span> Boolean.FalseString.ToLower();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &#39;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span> }</pre>
</p></div>
</div>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MapHelper {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">public</span> MapHelper() {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> String BooleanValue(<span style="color:#0000ff;">bool</span> val) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">if</span> (val)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            <span style="color:#0000ff;">return</span> Boolean.TrueString.ToLower();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">else</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            <span style="color:#0000ff;">return</span> Boolean.FalseString.ToLower();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">}</pre>
</pre>
<p>This code has most likely been written before .Net 2.0, back when there wasn&#8217;t any static classes. I have no idea why the empty default constructor has been added, but I&#8217;ve seen that done in a lot of C# code written by Java developers, so perhaps it&#8217;s a Java habit? I dunno. Anyways, the more correct implementation of this code would of course be to remove the empty constructor and mark the class as static. Of course the code should also be commented and there are some Globalization issues with using the &quot;ToLower&quot; method.</p>
<p>And another one:</p>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> String saveInvoiceToContentmanager(<span style="color:#0000ff;">string</span> originalDocument, <span style="color:#0000ff;">string</span> pdfFileName, <span style="color:#0000ff;">string</span> clientID)
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">{
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    <span style="color:#008000;">// create the client to connect</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    Client client = <span style="color:#0000ff;">new</span> Client(clientID);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">try</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#008000;">// open a connection to the client.</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        client.Open();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#008000;">// save the original document into the content repository</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">string</span> filename = Path.Combine(Path.GetTempPath(), System.Guid.NewGuid().ToString() + &quot;<span style="color:#8b0000;">.xml</span>&quot;);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">using</span> (StreamWriter streamWriter = <span style="color:#0000ff;">new</span> StreamWriter(<span style="color:#0000ff;">new</span> FileStream(filename, FileMode.Create))) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            streamWriter.Write(originalDocument);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">try</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            docId = Client.NewDocId();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            client.CreateContent(<span style="color:#0000ff;">new</span> <span style="color:#0000ff;">string</span>[] { pdfFileName, filename });
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            <span style="color:#0000ff;">try</span>  {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">                File.Delete(pdfFileName);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            <span style="color:#0000ff;">catch</span> (Exception) { }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">finally</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            <span style="color:#0000ff;">try</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">                File.Delete(filename);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            <span style="color:#0000ff;">catch</span> (Exception) { }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#0000ff;">finally</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">try</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            client.Close();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">catch</span> (Exception) { }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">}</pre>
</pre>
<p>This one comes with a plethora of issues! There are some good patterns in here though, if you look carefully. The developer has avoided the try-catch-finally trap. What trap you say? Well, it doesn&#8217;t make sense to use all three keywords together, it should be either try-catch or try-finally. I&#8217;d make a couple of changes in this code. For starters I&#8217;d implement the IDisposable interface in the Client class (yes, in this example that would be possible) and then I&#8217;d add some more if statements before the first File.Delete call, to make sure that we&#8217;d be able to delete the file. Retry code such as this is hardly a good idea. The code doesn&#8217;t provide any hints as to way this is done, but I&#8217;m assuming that it&#8217;s a delay in letting the file-handle go from other parts of the code. And finally the casing is Java style for the method name. So my version would perhaps look a bit like this:</p>
<pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> <span style="color:#0000ff;">string</span> SaveInvoiceToContentmanager(<span style="color:#0000ff;">string</span> originalDocument, <span style="color:#0000ff;">string</span> pdfFileName, <span style="color:#0000ff;">string</span> clientID) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">    <span style="color:#008000;">// create the client to connect</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    <span style="color:#0000ff;">using</span> (Client client = <span style="color:#0000ff;">new</span> Client(clientID)) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#008000;">// open a connection to the client.</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        client.Open();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#008000;">// save the original document into the content repository</span>
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        <span style="color:#0000ff;">string</span> filename = Path.Combine(Path.GetTempPath(), System.Guid.NewGuid().ToString() + &quot;<span style="color:#8b0000;">.xml</span>&quot;);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">using</span> (StreamWriter streamWriter = <span style="color:#0000ff;">new</span> StreamWriter(<span style="color:#0000ff;">new</span> FileStream(filename, FileMode.Create))) {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            streamWriter.Write(originalDocument);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;"></pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">try</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            docId = Client.NewDocId();
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">            client.CreateContent(<span style="color:#0000ff;">new</span> <span style="color:#0000ff;">string</span>[] { pdfFileName, filename });
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">        <span style="color:#0000ff;">finally</span> {
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">            <span style="color:#0000ff;">if</span> (File.Exists(filename))
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">                File.Delete(filename);
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">        }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#fbfbfb;margin:0;">    }
</pre>
<pre style="font-size:12px;width:100%;font-family:consolas,&#39;background-color:#ffffff;margin:0;">}</pre>
</pre>
<p>Of course you could always improve this code even further by making use of a Dependency Injection container, such as <a href="http://structuremap.sourceforge.net/Default.htm">Structure Map</a>, but that&#8217;s all for another day. But, and here comes the real point of my post (!); how would one be able to trap these sorts of bugs? Yes, I call lack of code quality a bug. I&#8217;d recommend using static code analysis and CI build environment. That should catch perhaps 80% of the bugs, like the static class stuff. And then make sure to do proper code review, aka Peer Review.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/icodenazi.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/icodenazi.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/icodenazi.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/icodenazi.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/icodenazi.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/icodenazi.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/icodenazi.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/icodenazi.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/icodenazi.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/icodenazi.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/icodenazi.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/icodenazi.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=4&subd=icodenazi&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://icodenazi.wordpress.com/2008/06/10/bad-code-examples-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fce6388ae17f02a65fb3e9765be73d25?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noocyte</media:title>
		</media:content>
	</item>
		<item>
		<title>First post, new blog; Summer is here</title>
		<link>http://icodenazi.wordpress.com/2008/06/06/first-post-new-blog-summer-is-here/</link>
		<comments>http://icodenazi.wordpress.com/2008/06/06/first-post-new-blog-summer-is-here/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 08:36:54 +0000</pubDate>
		<dc:creator>noocyte</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[intro]]></category>

		<guid isPermaLink="false">http://icodenazi.wordpress.com/?p=3</guid>
		<description><![CDATA[So the heading doesn&#8217;t make sense, but this is my first post on my new blog; ICodeNazi. Please note the capitalization, it&#8217;s intended of course. BUt what&#8217;s with the name of the blog? You&#8217;ve probably seen Seinfeld and perhaps the infamous &#8220;Soup Nazi&#8221; episode? My blog is inspired by the soup nazi, only I won&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=3&subd=icodenazi&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So the heading doesn&#8217;t make sense, but this <em>is</em> my first post on my new blog; ICodeNazi. Please note the capitalization, it&#8217;s intended of course. BUt what&#8217;s with the name of the blog? You&#8217;ve probably seen Seinfeld and perhaps the infamous &#8220;<a href="http://en.wikipedia.org/wiki/Soup_Nazi">Soup Nazi</a>&#8221; episode? My blog is inspired by the soup nazi, only I won&#8217;t be serving soup. I will be talking about code quality, code refactoring and code layout. Links to interesting stuff will still be served every now and then on <a href="http://noocyte.wordpress.com">my old blog</a>, but this blog will be just my content and only on code. I&#8217;m no expert, so this is also an attempt to learn something, but I am passionate about code quality. I love taking ugly code and running code analysis on it; removing anti-patterns and refactoring it to be easier to read and more maintainable. Let me tell you abit more about the history of this blog;</p>
<p>I&#8217;ve always been interested in computers and programming, for as long as I can remember I&#8217;ve loved taking things apart and at some point I also started putting them back together again. I&#8217;ve been a developer in my heart since 1994 and a .net coder since 2002. I used to love building machines, for friends and family, setting up networks and throing LAN parties&#8230; I&#8217;ve created a few websites, ugly, but working. I&#8217;ve done heaps of things and I enmjoy doing it all. However for the longest time I struggled with finding something that I really, really loved doing. Something that I could perhaps be very good at, not just knowledgeable at. You see I&#8217;ve always said that I know a little about most things and little about anything. I&#8217;m a &#8220;jack of all trades&#8221;  I guess. But a spring morning in April it just dawned on me; I love refactoring, I love writing unit tests for legacy code, I love removing old and dead code and I love to watch code go from ugly and unstructured to structured and beautiful code. I really love it! So I found my passion! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Go me!</p>
<p>As I&#8217;ve already said; I&#8217;m no expert. I&#8217;m just passionate about this and so I will try to blog my experiences with tools (PEX, Resharper etc.), my project experiences and I will tell you my opinion in matters related to code quality.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/icodenazi.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/icodenazi.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/icodenazi.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/icodenazi.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/icodenazi.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/icodenazi.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/icodenazi.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/icodenazi.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/icodenazi.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/icodenazi.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/icodenazi.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/icodenazi.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=icodenazi.wordpress.com&blog=3829252&post=3&subd=icodenazi&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://icodenazi.wordpress.com/2008/06/06/first-post-new-blog-summer-is-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fce6388ae17f02a65fb3e9765be73d25?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">noocyte</media:title>
		</media:content>
	</item>
	</channel>
</rss>