<?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: Useless code</title>
	<atom:link href="http://losingfight.com/blog/2007/05/08/useless-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://losingfight.com/blog/2007/05/08/useless-code/</link>
	<description>because i don&#039;t write software for windows</description>
	<lastBuildDate>Mon, 27 Feb 2012 21:23:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Uli Kusterer</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-429</link>
		<dc:creator>Uli Kusterer</dc:creator>
		<pubDate>Tue, 22 May 2007 09:20:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-429</guid>
		<description>Maybe the programmer just needed a place to set a breakpoint on? This is essentially a no-op, but it still compiles to something. If this is a place where he needs to break often during debugging (i.e. it was some sort of main entry point or bottleneck), he&#039;ll be happy if he can just uncomment this thing, put a breakpoint next to it and get debugging.

And maybe one programmer put this code there, and another came by, thought: &quot;What&#039;s the point of this? I&#039;ll comment it out and ask Jeff why he did that!&quot; And that&#039;s how it happened. If nobody had to debug this spot recently, it may have just not been uncommented again.

I could see dozens of reasons for such a statement, all perfectly valid.</description>
		<content:encoded><![CDATA[<p>Maybe the programmer just needed a place to set a breakpoint on? This is essentially a no-op, but it still compiles to something. If this is a place where he needs to break often during debugging (i.e. it was some sort of main entry point or bottleneck), he&#8217;ll be happy if he can just uncomment this thing, put a breakpoint next to it and get debugging.</p>
<p>And maybe one programmer put this code there, and another came by, thought: &#8220;What&#8217;s the point of this? I&#8217;ll comment it out and ask Jeff why he did that!&#8221; And that&#8217;s how it happened. If nobody had to debug this spot recently, it may have just not been uncommented again.</p>
<p>I could see dozens of reasons for such a statement, all perfectly valid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Grynspan</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-428</link>
		<dc:creator>Jonathan Grynspan</dc:creator>
		<pubDate>Sat, 12 May 2007 03:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-428</guid>
		<description>It&#039;s possible that, at some point in the development cycle, a complex expression was in the place of that &quot;1&quot;, as well as in other places. As the program evolved, the expression became obsolete and a clever developer decided to replace all instances with &quot;1&quot; to avoid having to modify logic or redo unit testing.

It&#039;s a bit of a stretch, but one can hope that the developer was not so blatantly dumb.</description>
		<content:encoded><![CDATA[<p>It&#8217;s possible that, at some point in the development cycle, a complex expression was in the place of that &#8220;1&#8243;, as well as in other places. As the program evolved, the expression became obsolete and a clever developer decided to replace all instances with &#8220;1&#8243; to avoid having to modify logic or redo unit testing.</p>
<p>It&#8217;s a bit of a stretch, but one can hope that the developer was not so blatantly dumb.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Sudarkoff</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-427</link>
		<dc:creator>George Sudarkoff</dc:creator>
		<pubDate>Wed, 09 May 2007 05:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-427</guid>
		<description>You want to see HUGE functions? Look at this: http://george.sudarkoff.com/2007/02/_how_many_problems_can.html</description>
		<content:encoded><![CDATA[<p>You want to see HUGE functions? Look at this: <a href="http://george.sudarkoff.com/2007/02/_how_many_problems_can.html" rel="nofollow">http://george.sudarkoff.com/2007/02/_how_many_problems_can.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-426</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 05:23:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-426</guid>
		<description>&quot;Where is there loads of code in a switch-case in the first place?&quot;

Oops, should be &quot;Why&quot; instead of &quot;Where&quot;.</description>
		<content:encoded><![CDATA[<p>&#8220;Where is there loads of code in a switch-case in the first place?&#8221;</p>
<p>Oops, should be &#8220;Why&#8221; instead of &#8220;Where&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-425</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 05:21:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-425</guid>
		<description>In my previous full-time job before this startup, i&#039;ve seen quite a few scary bits of useless code too.

else clauses with no code inside.

switch-case statements with LOTS of unreachable code following a break statement, which makes you really, really scared.  Where is there loads of code in a switch-case in the first place?  Ahhh, that&#039;s a much longer story for another day.

Lots of &quot;legacy functions&quot; that nothing is calling anymore.  And these functions are HUGE (more than 150 lines for sure).

Life as a maintenance programmer is good.</description>
		<content:encoded><![CDATA[<p>In my previous full-time job before this startup, i&#8217;ve seen quite a few scary bits of useless code too.</p>
<p>else clauses with no code inside.</p>
<p>switch-case statements with LOTS of unreachable code following a break statement, which makes you really, really scared.  Where is there loads of code in a switch-case in the first place?  Ahhh, that&#8217;s a much longer story for another day.</p>
<p>Lots of &#8220;legacy functions&#8221; that nothing is calling anymore.  And these functions are HUGE (more than 150 lines for sure).</p>
<p>Life as a maintenance programmer is good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Sudarkoff</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-424</link>
		<dc:creator>George Sudarkoff</dc:creator>
		<pubDate>Wed, 09 May 2007 05:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-424</guid>
		<description>We all have our own little moments (and idiosyncrasies). Sometimes, especially when you are chasing after a particularly illusive bug, such small reassurances of things still being generally sane might help you not to loose it completely.

Or maybe it&#039;s a reminder for something. Or a case of careless find and replace. Or a result of some script running. Or this is a custom ASSERT that does more than you think. I mean, who knows? Don&#039;t be so quick to judge. :)</description>
		<content:encoded><![CDATA[<p>We all have our own little moments (and idiosyncrasies). Sometimes, especially when you are chasing after a particularly illusive bug, such small reassurances of things still being generally sane might help you not to loose it completely.</p>
<p>Or maybe it&#8217;s a reminder for something. Or a case of careless find and replace. Or a result of some script running. Or this is a custom ASSERT that does more than you think. I mean, who knows? Don&#8217;t be so quick to judge. <img src='http://losingfight.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-423</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 02:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-423</guid>
		<description>Ooops, that&#039;s right.  Serves me right for replying to blogs 10 mins after waking up. :-)

Hmm, in that case, I have no idea why he wrote that line.  If the original coder is still around, perhaps you should ask him (nicely).</description>
		<content:encoded><![CDATA[<p>Ooops, that&#8217;s right.  Serves me right for replying to blogs 10 mins after waking up. <img src='http://losingfight.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Hmm, in that case, I have no idea why he wrote that line.  If the original coder is still around, perhaps you should ask him (nicely).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-422</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 09 May 2007 02:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-422</guid>
		<description>Well, ASSERT(1) would _never_ fire, where had he done ASSERT(0), that would fire all the time.

And like you said, ASSERTs that fire all the time can be useful (i.e. if you reach a code flow that shouldn&#039;t ever be reached).</description>
		<content:encoded><![CDATA[<p>Well, ASSERT(1) would _never_ fire, where had he done ASSERT(0), that would fire all the time.</p>
<p>And like you said, ASSERTs that fire all the time can be useful (i.e. if you reach a code flow that shouldn&#8217;t ever be reached).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Goh</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-421</link>
		<dc:creator>Joe Goh</dc:creator>
		<pubDate>Wed, 09 May 2007 01:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-421</guid>
		<description>There could be another reason why he chose to do ASSERT(1) - to make sure that assertions are not compiled in the release build, or some other reason where he would want assertions to trigger everytime.  Is this ASSERT(1) in the -init method?

The good news though is that at least he uses ASSERT().  I&#039;ve known quiite a few coders in the past who have not even heard of the concept.</description>
		<content:encoded><![CDATA[<p>There could be another reason why he chose to do ASSERT(1) &#8211; to make sure that assertions are not compiled in the release build, or some other reason where he would want assertions to trigger everytime.  Is this ASSERT(1) in the -init method?</p>
<p>The good news though is that at least he uses ASSERT().  I&#8217;ve known quiite a few coders in the past who have not even heard of the concept.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://losingfight.com/blog/2007/05/08/useless-code/comment-page-1/#comment-420</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 09 May 2007 01:07:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.losingfight.com/blog/2007/05/08/useless-code/#comment-420</guid>
		<description>Oh, I have Worse Than Failure (the new name) in my RSS feed. :-)</description>
		<content:encoded><![CDATA[<p>Oh, I have Worse Than Failure (the new name) in my RSS feed. <img src='http://losingfight.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

