<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Coding: The guilty bystander</title>
	<atom:link href="http://www.markhneedham.com/blog/2009/08/30/coding-the-guilty-bystander/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2009/08/30/coding-the-guilty-bystander/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dave Cameron</title>
		<link>http://www.markhneedham.com/blog/2009/08/30/coding-the-guilty-bystander/comment-page-1/#comment-21910</link>
		<dc:creator>Dave Cameron</dc:creator>
		<pubDate>Mon, 31 Aug 2009 15:15:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1594#comment-21910</guid>
		<description>Thinking about this more today, my opinion on it comes from a pretty specific context. It was a project where we were aiming for monthly releases, had only unit tests but no functional automated tests, a large code base with a lot of features, and generally high code quality. Changes required manual test effort from a team that was half the size of the total development team. The team was fairly enthusiastic about improving the code base; technical activities were not tightly controlled by management. Probably in another context, more cleanup or more effort to clean up would be a good thing.

In either situation though, I think TODOs are pretty counterproductive. I agree with Evan, they are usually more of an order or command but without a defined person actually being commanded. I would rather people experiment with quick scratch refactorings to see how the code could be improved. A scratch refactoring should take 10 minutes or less. The time will come when the refactoring makes good sense in the context of a story being played and one of the ideas generated from the scratches can be done and committed.</description>
		<content:encoded><![CDATA[<p>Thinking about this more today, my opinion on it comes from a pretty specific context. It was a project where we were aiming for monthly releases, had only unit tests but no functional automated tests, a large code base with a lot of features, and generally high code quality. Changes required manual test effort from a team that was half the size of the total development team. The team was fairly enthusiastic about improving the code base; technical activities were not tightly controlled by management. Probably in another context, more cleanup or more effort to clean up would be a good thing.</p>
<p>In either situation though, I think TODOs are pretty counterproductive. I agree with Evan, they are usually more of an order or command but without a defined person actually being commanded. I would rather people experiment with quick scratch refactorings to see how the code could be improved. A scratch refactoring should take 10 minutes or less. The time will come when the refactoring makes good sense in the context of a story being played and one of the ideas generated from the scratches can be done and committed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/08/30/coding-the-guilty-bystander/comment-page-1/#comment-21881</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Sun, 30 Aug 2009 13:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1594#comment-21881</guid>
		<description>@Dave -  I think you&#039;ve articulated better than I have the idea of &#039;The first opportunity&#039; - the next time you use it seems to work quite nicely as a  rule of thumb although I guess it would depend a lot on when that next time was. If it was while doing a production fix then I imagine we probabably wouldn&#039;t want to do the refactoring at that stage since there&#039;s a chance of introducing another problem into the code.

Which then links to your idea that we can introduce bugs at any time when we change code. 

I don&#039;t think I quite understand when we will and when we won&#039;t experience gains by choosing to refactor an area.

There are certainly smells in code that are really easy to see that indicate something should be done but like you say if we go and refactor an area that noone is currently working on then it might be pointless anyway.

I wonder if we should look to spend more time refactoring code that is in the core domain or inside the green house to use the Eric Evans analogy?

@Evan - I think like you I&#039;d prefer the default to err on the side of overdoing the refactoring but being aware that we have that tendency so we can work out when we&#039;ve gone too far instead of choosing the easy way and ending up with a code base that&#039;s really difficult to work with.

I&#039;m not sure of my thinking of TODO - what you say makes a lot of sense &amp; in our current code base we have so many TODOs it&#039;s ridiculous.

I think maybe it&#039;s more a team discipline thing to make sure we do go and fix the code around the areas that are important to our progress.</description>
		<content:encoded><![CDATA[<p>@Dave &#8211;  I think you&#8217;ve articulated better than I have the idea of &#8216;The first opportunity&#8217; &#8211; the next time you use it seems to work quite nicely as a  rule of thumb although I guess it would depend a lot on when that next time was. If it was while doing a production fix then I imagine we probabably wouldn&#8217;t want to do the refactoring at that stage since there&#8217;s a chance of introducing another problem into the code.</p>
<p>Which then links to your idea that we can introduce bugs at any time when we change code. </p>
<p>I don&#8217;t think I quite understand when we will and when we won&#8217;t experience gains by choosing to refactor an area.</p>
<p>There are certainly smells in code that are really easy to see that indicate something should be done but like you say if we go and refactor an area that noone is currently working on then it might be pointless anyway.</p>
<p>I wonder if we should look to spend more time refactoring code that is in the core domain or inside the green house to use the Eric Evans analogy?</p>
<p>@Evan &#8211; I think like you I&#8217;d prefer the default to err on the side of overdoing the refactoring but being aware that we have that tendency so we can work out when we&#8217;ve gone too far instead of choosing the easy way and ending up with a code base that&#8217;s really difficult to work with.</p>
<p>I&#8217;m not sure of my thinking of TODO &#8211; what you say makes a lot of sense &#038; in our current code base we have so many TODOs it&#8217;s ridiculous.</p>
<p>I think maybe it&#8217;s more a team discipline thing to make sure we do go and fix the code around the areas that are important to our progress.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Bottcher</title>
		<link>http://www.markhneedham.com/blog/2009/08/30/coding-the-guilty-bystander/comment-page-1/#comment-21880</link>
		<dc:creator>Evan Bottcher</dc:creator>
		<pubDate>Sun, 30 Aug 2009 13:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1594#comment-21880</guid>
		<description>There&#039;s definitely a high risk of a yak shaving escapade if you set off to clean up everything that you find while coding - it&#039;s a judgement call to choose how far to go.  I think more often than not teams I work with by default choose the easy option and do not shave enough yak.

I find TODO comments a symptom of this - a colleague of mine once said that he was annoyed by TODOs, that they&#039;re a statement of &#039;I can&#039;t be bothered doing this, I want YOU TODO this&quot;.

I love the &#039;guilty bystander&#039; analogy btw.</description>
		<content:encoded><![CDATA[<p>There&#8217;s definitely a high risk of a yak shaving escapade if you set off to clean up everything that you find while coding &#8211; it&#8217;s a judgement call to choose how far to go.  I think more often than not teams I work with by default choose the easy option and do not shave enough yak.</p>
<p>I find TODO comments a symptom of this &#8211; a colleague of mine once said that he was annoyed by TODOs, that they&#8217;re a statement of &#8216;I can&#8217;t be bothered doing this, I want YOU TODO this&#8221;.</p>
<p>I love the &#8216;guilty bystander&#8217; analogy btw.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Cameron</title>
		<link>http://www.markhneedham.com/blog/2009/08/30/coding-the-guilty-bystander/comment-page-1/#comment-21878</link>
		<dc:creator>Dave Cameron</dc:creator>
		<pubDate>Sun, 30 Aug 2009 12:44:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1594#comment-21878</guid>
		<description>I think that taking a mental note of the code that needs improvement and returning to it at the first opportunity is the right thing todo. &quot;The first opportunity&quot; is a subtle thing, however. The very next time the code needs to be touched is the right time to clean it up. As you experienced, not doing so could easily lead to further bugs. 

There is another reason not to change code besides Silvio&#039;s point that there might not be time. Changing code introduces risk. Any change can introduce bugs, even while making the code more flexible. Even code that seems obviously incorrect might be providing a behaviour that the business relies on. If an area is already being changed then there will already be acceptance and regression plans in place. Any clean up efforts can be validated by the same tests. 

A drive-by refactoring of an area where change is not planned, on the other hand, can easily introduce defects not detected until much later. This will end up slowing the team down when the goal was to go faster. If there is no other work to do besides refactoring it is best to treat it as a scratch refactoring. Try out some wild ideas but the throw the changes away. When the opportunity does come up to change that code, you will probably know exactly the changes you&#039;d like to make.</description>
		<content:encoded><![CDATA[<p>I think that taking a mental note of the code that needs improvement and returning to it at the first opportunity is the right thing todo. &#8220;The first opportunity&#8221; is a subtle thing, however. The very next time the code needs to be touched is the right time to clean it up. As you experienced, not doing so could easily lead to further bugs. </p>
<p>There is another reason not to change code besides Silvio&#8217;s point that there might not be time. Changing code introduces risk. Any change can introduce bugs, even while making the code more flexible. Even code that seems obviously incorrect might be providing a behaviour that the business relies on. If an area is already being changed then there will already be acceptance and regression plans in place. Any clean up efforts can be validated by the same tests. </p>
<p>A drive-by refactoring of an area where change is not planned, on the other hand, can easily introduce defects not detected until much later. This will end up slowing the team down when the goal was to go faster. If there is no other work to do besides refactoring it is best to treat it as a scratch refactoring. Try out some wild ideas but the throw the changes away. When the opportunity does come up to change that code, you will probably know exactly the changes you&#8217;d like to make.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

