<?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: Unused code</title>
	<atom:link href="http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 31 Jul 2010 12:46:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Tiendq</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21739</link>
		<dc:creator>Tiendq</dc:creator>
		<pubDate>Wed, 26 Aug 2009 08:37:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21739</guid>
		<description>Of course, don&#039;t forget to leave a meaningful comment at where code is removed.</description>
		<content:encoded><![CDATA[<p>Of course, don't forget to leave a meaningful comment at where code is removed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tiendq</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21738</link>
		<dc:creator>Tiendq</dc:creator>
		<pubDate>Wed, 26 Aug 2009 08:35:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21738</guid>
		<description>We have been refactoring our code base of last project and face this issue too. Unused and long comment out code make me sick during code review. It cost me lots of time to find out if a specific method is used or not, code coverage is very useful in this situation but it isn&#039;t always right in all cases. I think the quickest and most efficient approach for this issue is removing it completely. If developers need it later, just come to code repository.</description>
		<content:encoded><![CDATA[<p>We have been refactoring our code base of last project and face this issue too. Unused and long comment out code make me sick during code review. It cost me lots of time to find out if a specific method is used or not, code coverage is very useful in this situation but it isn't always right in all cases. I think the quickest and most efficient approach for this issue is removing it completely. If developers need it later, just come to code repository.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21632</link>
		<dc:creator>Mark Needham</dc:creator>
		<pubDate>Fri, 21 Aug 2009 12:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21632</guid>
		<description>Interesting ideas, I guess perhaps the option of branching/tagging the feature and then removing it is probably a reasonable approach.

Strangely enough straight after I posted this I was working on some code with a colleague and a feature we originally implemented 6 months ago but which was then deemed unnecessay was rewritten in an ever so slightly different way cause we had different people working on it the second time than the first and we didn&#039;t pick up on the fact it was already done a different way!

Quite frustrating because the old code is now getting in the way and has increased the complexity of what we&#039;re doing.</description>
		<content:encoded><![CDATA[<p>Interesting ideas, I guess perhaps the option of branching/tagging the feature and then removing it is probably a reasonable approach.</p>
<p>Strangely enough straight after I posted this I was working on some code with a colleague and a feature we originally implemented 6 months ago but which was then deemed unnecessay was rewritten in an ever so slightly different way cause we had different people working on it the second time than the first and we didn't pick up on the fact it was already done a different way!</p>
<p>Quite frustrating because the old code is now getting in the way and has increased the complexity of what we're doing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ilivewithian</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21631</link>
		<dc:creator>ilivewithian</dc:creator>
		<pubDate>Fri, 21 Aug 2009 11:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21631</guid>
		<description>I&#039;m with Jeremy, branch the code. Even if you&#039;ve ended up with the code in the main trunk branch it, then delete it from the trunk.

I try to keep the main trunk as clean as possible, that way moving towards continuous deployment becomes more realistic.</description>
		<content:encoded><![CDATA[<p>I'm with Jeremy, branch the code. Even if you've ended up with the code in the main trunk branch it, then delete it from the trunk.</p>
<p>I try to keep the main trunk as clean as possible, that way moving towards continuous deployment becomes more realistic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijay Aravamudhan</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21630</link>
		<dc:creator>Vijay Aravamudhan</dc:creator>
		<pubDate>Fri, 21 Aug 2009 11:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21630</guid>
		<description>One other (hard-line) approach is to simply nuke the code. If it is sufficiently soon AND important that it needs to be resurrected, someone on the team would remember that this code was checked in (and could later find it with the commit history logs - assuming that you checked it in at least once). This approach also allows the [possibly] new pair to implement it in a different manner (debatable whether the new one is actually better or not) - but hopefully with more knowledge of the changed business process/requirement.</description>
		<content:encoded><![CDATA[<p>One other (hard-line) approach is to simply nuke the code. If it is sufficiently soon AND important that it needs to be resurrected, someone on the team would remember that this code was checked in (and could later find it with the commit history logs &#8211; assuming that you checked it in at least once). This approach also allows the [possibly] new pair to implement it in a different manner (debatable whether the new one is actually better or not) &#8211; but hopefully with more knowledge of the changed business process/requirement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Carver</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21625</link>
		<dc:creator>Frank Carver</dc:creator>
		<pubDate>Fri, 21 Aug 2009 09:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21625</guid>
		<description>The idea of removing the code from the current version, and leaving the footprints in the source control system is appealing, but it does have its probblems.

Having taken this approach without regrets several times, I eventually found myself actually needing to look up some old unused and deleted code. 

Unfortunately it was very hard to find. Most SCM systems I have used treat the file as the key repository item, and make access to the history of deleted files quite tricky. This is just about doable if you can remember the name of the file in question, but this is not often true in a highly fluid, mercilessly-refactoring code base.

Finding the various bits which comprised the deleted feature turned into quite a forensic exercise.

My recommendation is that you should *always* meaningfully tag or branch the repository state before performing such a deletion. This few seconds of effort can save hours of frustration if you do ever need to look back.</description>
		<content:encoded><![CDATA[<p>The idea of removing the code from the current version, and leaving the footprints in the source control system is appealing, but it does have its probblems.</p>
<p>Having taken this approach without regrets several times, I eventually found myself actually needing to look up some old unused and deleted code. </p>
<p>Unfortunately it was very hard to find. Most SCM systems I have used treat the file as the key repository item, and make access to the history of deleted files quite tricky. This is just about doable if you can remember the name of the file in question, but this is not often true in a highly fluid, mercilessly-refactoring code base.</p>
<p>Finding the various bits which comprised the deleted feature turned into quite a forensic exercise.</p>
<p>My recommendation is that you should *always* meaningfully tag or branch the repository state before performing such a deletion. This few seconds of effort can save hours of frustration if you do ever need to look back.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willem van den Ende</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21620</link>
		<dc:creator>Willem van den Ende</dc:creator>
		<pubDate>Fri, 21 Aug 2009 08:30:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21620</guid>
		<description>I&#039;m with Mark Dalgarno on this. Remove it, and you _could_ refer to it later. 
In practice referring back to it rarely happens - as you say, the business idea of the abandoned feature has evolved in the meantime, so it is much faster to write new tests with fresh code. 
I recommend throwing away code often. If there is one thing I should (still) be doing more is throwing away code e.g. keeping code after a spike and then moulding it into production ready code takes much longer than throwing the spike away and working again from tests, but still I can&#039;t help myself sometimes...</description>
		<content:encoded><![CDATA[<p>I'm with Mark Dalgarno on this. Remove it, and you _could_ refer to it later.<br />
In practice referring back to it rarely happens &#8211; as you say, the business idea of the abandoned feature has evolved in the meantime, so it is much faster to write new tests with fresh code.<br />
I recommend throwing away code often. If there is one thing I should (still) be doing more is throwing away code e.g. keeping code after a spike and then moulding it into production ready code takes much longer than throwing the spike away and working again from tests, but still I can't help myself sometimes&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Dalgarno</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21617</link>
		<dc:creator>Mark Dalgarno</dc:creator>
		<pubDate>Fri, 21 Aug 2009 07:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21617</guid>
		<description>The approach of removing it from the code base feels much cleaner and more satisfying to me.

If you do need the feature at a later date you should still have the knowledge of how it had been partially implemented and you should be able to refer back to your source control system to see what actually had been done complement this knowledge.</description>
		<content:encoded><![CDATA[<p>The approach of removing it from the code base feels much cleaner and more satisfying to me.</p>
<p>If you do need the feature at a later date you should still have the knowledge of how it had been partially implemented and you should be able to refer back to your source control system to see what actually had been done complement this knowledge.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #417</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21616</link>
		<dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #417</dc:creator>
		<pubDate>Fri, 21 Aug 2009 07:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21616</guid>
		<description>[...] Coding: Unused code - Mark Needham talks about the dilemma of what to do with code that is no longer needed, be it replaced or an abandoned partially implemented feature. [...]</description>
		<content:encoded><![CDATA[<p>[...] Coding: Unused code &#8211; Mark Needham talks about the dilemma of what to do with code that is no longer needed, be it replaced or an abandoned partially implemented feature. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Gray</title>
		<link>http://www.markhneedham.com/blog/2009/08/21/coding-unused-code/comment-page-1/#comment-21613</link>
		<dc:creator>Jeremy Gray</dc:creator>
		<pubDate>Fri, 21 Aug 2009 04:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=1561#comment-21613</guid>
		<description>Cut that code into a branch, nuke it in your main line of development (or cut a new main line of development, or whichever of a number of rough equivalents that best suit your chosen branching model), and then move on. If you do want to look back on it or even dredge it back up as it was, you&#039;ll have that branch there.</description>
		<content:encoded><![CDATA[<p>Cut that code into a branch, nuke it in your main line of development (or cut a new main line of development, or whichever of a number of rough equivalents that best suit your chosen branching model), and then move on. If you do want to look back on it or even dredge it back up as it was, you'll have that branch there.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
