<?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>Software Configuration Management and Agile Software Development &#187; bigballofmud</title>
	<atom:link href="http://accurev.com/blog/tag/bigballofmud/feed/" rel="self" type="application/rss+xml" />
	<link>http://accurev.com/blog</link>
	<description>SCM and Agile Software Development Blog</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:28:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Dr. Strangecode, or How I Learned to Stop Worrying and Love Old Code</title>
		<link>http://accurev.com/blog/2008/09/17/dr-strangecode-or-how-i-learned-to-stop-worrying-and-love-old-code/</link>
		<comments>http://accurev.com/blog/2008/09/17/dr-strangecode-or-how-i-learned-to-stop-worrying-and-love-old-code/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 12:43:32 +0000</pubDate>
		<dc:creator>cboran</dc:creator>
				<category><![CDATA[AccuRev]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Customer Guest Blogs]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[bigballofmud]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[martinfowler]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[SCCM]]></category>
		<category><![CDATA[SCM]]></category>
		<category><![CDATA[Software Configuration Management]]></category>

		<guid isPermaLink="false">http://accurev.wordpress.com/?p=332</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://accurev.com/blog/2008/09/17/dr-strangecode-or-how-i-learned-to-stop-worrying-and-love-old-code/' addthis:title='Dr. Strangecode, or How I Learned to Stop Worrying and Love Old Code ' ><a href="//addthis.com/bookmark.php?v=250&#38;username=xa-4d2b47597ad291fb" class="addthis_button_compact">Share</a><span class="addthis_separator">&#124;</span><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a></div>by Chris Boran Several years ago I happened to be browsing in my favourite local bookstore and one book in particular caught my eye: Martin Fowler&#8217;s Refactoring: Improving the Design of Existing Code This is the book that changed my whole career. Up until that point, I had lived in a constant state of fear [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://accurev.com/blog/2008/09/17/dr-strangecode-or-how-i-learned-to-stop-worrying-and-love-old-code/' addthis:title='Dr. Strangecode, or How I Learned to Stop Worrying and Love Old Code '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://accurev.com/blog/2008/09/17/dr-strangecode-or-how-i-learned-to-stop-worrying-and-love-old-code/' addthis:title='Dr. Strangecode, or How I Learned to Stop Worrying and Love Old Code ' ><a href="//addthis.com/bookmark.php?v=250&amp;username=xa-4d2b47597ad291fb" class="addthis_button_compact">Share</a><span class="addthis_separator">|</span><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a></div><p>by Chris Boran</p>
<p>Several years ago I happened to be browsing in my favourite local bookstore and one book in particular caught my eye: <a title="Martin Fowler" href="http://www.martinfowler.com" target="_blank">Martin Fowler&#8217;s</a> <a title="Refactoring" href="http://www.amazon.com/exec/obidos/ASIN/0201485672" target="_blank">Refactoring: Improving the Design of Existing Code</a></p>
<p>This is the book that changed my whole career. Up until that point, I had lived in a constant state of fear of change. I viewed old code as a house of cards &#8211; if I wasn&#8217;t very careful, it was all going to come down around me. Whenever my boss asked me for advice about what to do in a given area of the code, my answers were almost always similar to:</p>
<blockquote><p>The risk of doing anything but the smallest possible change is <strong>huge</strong> &#8211; so either we do something that is an ugly hack that we will regret later, or we need to take the whole thing apart and re-implement the whole subsystem from the ground up.</p></blockquote>
<p>And predictably, my boss&#8217;s answer was always something like:</p>
<blockquote><p>Okay, we will live with the hack for now, but in the next release we will make time to do it right.</p></blockquote>
<p>Of course every release we were forced to make many similar decisions. When the next release would come, the newly conceived product features would get priority over fixing code that was already working passably. In practice we might get lucky and be able to spend lots of time rewriting a single small subsystem, but introduce ugly hacks that would put 4 other systems on the map for future re-implementation.</p>
<p>The end result is affectionately referred to as a <a title="BigBallOfMud" href="http://en.wikipedia.org/wiki/Big_ball_of_mud" target="_blank">Big Ball of Mud</a>. Yup, it is every bit as pleasant as it sounds. Life is just so miserable when you come to work every day knowing you are going to have to pack another layer of mud on the ball. You gripe about it. Your teammates gripe about it. Your boss gripes about it. Somehow you never seem to make a whole lot of forward progress.</p>
<p>As I read the book, I was at first skeptical. I thought that bad old code needed to be thrown away and not revitalized! But I wanted to see if it would work, and so I set out to try it. I was very careful to follow the techniques exactly as they are laid out in the book. I made sure not to use the word refactor when I really meant rewrite. I was careful to refactor the code every time I saw something I wanted to change and not just note it for later. I made sure that my refactorings were small. I took my time with it.</p>
<p>Obviously working this way required that I also be doing very good unit testing, but I had already bought into <a title="TestDrivenDevelopment" href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank">Test Driven Development</a>. I was already writing unit tests for code before fixing bugs in an attempt to prevent regressions. Running these tests after each refactoring was not a big challenge for me.</p>
<p>Bit by bit I discovered the truth. By applying the refactoring techniques, I could take pieces that I thought needed to completely rewriten and make them better while I was fixing bugs in that area. I could kill two birds with one stone.</p>
<p>Then I discovered <a title="Eclipse" href="http://eclipse.org" target="_blank">Eclipse</a>. The built-in refactoring browser captivated me. Suddenly there was a good, fool proof way to do many of the common refactorings, and automation to keep them introducing new errors. My commitment to refactoring was completed and the defect rates in the code that I was responsible for maintaining declined dramatically. I was a convert. Since that time refactoring has been a cornerstone technique in my arsenal. I no longer lived in fear and loathing of old code!</p>
<p>One refactoring that I have still found to be painful, despite Eclipse&#8217;s facilities, is renaming files/classes. In most <a href="http://www.accurev.com/software-configuration-management-resources.htm" target="_blank">software configuration management</a> (SCM) tools, renaming files can have unfortunate unintended side effects because the identity of a file is its path. This leads to a great many developers to name a class once, and then never change its name &#8211; even if that name does not make sense and the design of the code and the classes primary purpose and responsibilities change.</p>
<p>Luckily for me, I am a long time Accurev user. In Accurev, files are not identified by their pathnames, but rather by a unique id. This makes it possible to quickly and easily rename files with no negative side effect. However this process was inconvenient &#8211; I would have to drop out of Eclipse, rename the file with Accurev&#8217;s tools, and then refresh my workspace. Not ideal, but it worked. That is why I was so pleased when the <a title="AccurevEclipse" href="http://www.accurev.com/accubridge-eclipse.html" target="_blank">Accurev-Eclipse Plugin</a> was released &#8211; it integrated the Eclipse Refactoring browser&#8217;s rename actions with Accurev&#8217;s capabilities to make the whole experience seemless. Accurev has helped me to maintain well thought out, easy to understand designs despite constant evolution to those designs.</p>
<div id="adb-tooltip">
<div style="border: 5px solid #c4dae8; font-family: arial; font-style: normal; font-variant: normal; font-weight: bold; font-size: 11px; line-height: 13px; background-color: white; color: #333333; margin: 0;">
<div style="border: 1px solid #78b3d9; text-align: left; padding: 5px;">
<div>Person<span style="color: #006699;"> Martin Fowler&#8217;s</span></div>
<div style="color: #999999; line-height: 14px;">Right click for SmartMenu shortcuts</div>
</div>
</div>
</div>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://accurev.com/blog/2008/09/17/dr-strangecode-or-how-i-learned-to-stop-worrying-and-love-old-code/' addthis:title='Dr. Strangecode, or How I Learned to Stop Worrying and Love Old Code '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://accurev.com/blog/2008/09/17/dr-strangecode-or-how-i-learned-to-stop-worrying-and-love-old-code/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

