<?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: The Zen of Doing It Wrong</title>
	<atom:link href="http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/</link>
	<description>a leaf on the wind</description>
	<lastBuildDate>Fri, 05 Feb 2010 13:33:48 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mike Pirnat &#187; The Diaper Pattern Stinks</title>
		<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/comment-page-1/#comment-346</link>
		<dc:creator>Mike Pirnat &#187; The Diaper Pattern Stinks</dc:creator>
		<pubDate>Sat, 09 May 2009 19:49:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.pirnat.com/mike/?p=1132#comment-346</guid>
		<description>[...] mentioned the &#8220;Diaper Pattern&#8221; in a recent post and got some comments asking what the term meant. I had hoped to just link to an explanation, [...]</description>
		<content:encoded><![CDATA[<p>[...] mentioned the &#8220;Diaper Pattern&#8221; in a recent post and got some comments asking what the term meant. I had hoped to just link to an explanation, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marius Gedminas</title>
		<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/comment-page-1/#comment-345</link>
		<dc:creator>Marius Gedminas</dc:creator>
		<pubDate>Thu, 07 May 2009 11:44:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.pirnat.com/mike/?p=1132#comment-345</guid>
		<description>So, what&#039;s a Diaper Pattern?</description>
		<content:encoded><![CDATA[<p>So, what&#8217;s a Diaper Pattern?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robert</title>
		<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/comment-page-1/#comment-344</link>
		<dc:creator>robert</dc:creator>
		<pubDate>Thu, 07 May 2009 06:16:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.pirnat.com/mike/?p=1132#comment-344</guid>
		<description>at least a single try-except block like this could probably be easily found in my code. and actually, other than being more code than necessary, i don&#039;t think there&#039;s a big problem with this. typically, i comment out the raise to do some testing. but i agreee, if production code means, all testing has been done - or is automated - superfluous code should be removed.</description>
		<content:encoded><![CDATA[<p>at least a single try-except block like this could probably be easily found in my code. and actually, other than being more code than necessary, i don&#8217;t think there&#8217;s a big problem with this. typically, i comment out the raise to do some testing. but i agreee, if production code means, all testing has been done &#8211; or is automated &#8211; superfluous code should be removed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guilty</title>
		<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/comment-page-1/#comment-343</link>
		<dc:creator>guilty</dc:creator>
		<pubDate>Thu, 07 May 2009 02:42:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.pirnat.com/mike/?p=1132#comment-343</guid>
		<description>hi,

I think I can explain the reason for this ugly code... I think :)


I bet the code at some point had some debugging code in there.  So there was a problem with the file operations perhaps.

These try: raise: pairs allow you to quickly add some debugging code in there.

Then when the code was finished, the programmer left it in there in case they needed to do some more debugging later.  So it was never cleaned up.

The pass were left in case the raise was to be removed... as I expect for the same reason it was left in.


Just some guesses... maybe I&#039;ve done similar ugly things in the past, and that&#039;s why I might have done this.


I guess in this case, it&#039;s similar to using these other ugly things...

# easily disable a block by changing one character.
if 0:
    do_stuff()

if 1:
    do_stuff()


// allow putting more than one thing in the if/else blocks... 
//     if you need to later.  
//     Since C doesn&#039;t require {} for single statements.
if(some_condition) {
    do_one_thing()
} else {
    do_one_thing()
}


Leaving ugly stuff like that in production code, lets you try and fix things quicker if needed.


cu,</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>I think I can explain the reason for this ugly code&#8230; I think <img src='http://www.pirnat.com/mike/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I bet the code at some point had some debugging code in there.  So there was a problem with the file operations perhaps.</p>
<p>These try: raise: pairs allow you to quickly add some debugging code in there.</p>
<p>Then when the code was finished, the programmer left it in there in case they needed to do some more debugging later.  So it was never cleaned up.</p>
<p>The pass were left in case the raise was to be removed&#8230; as I expect for the same reason it was left in.</p>
<p>Just some guesses&#8230; maybe I&#8217;ve done similar ugly things in the past, and that&#8217;s why I might have done this.</p>
<p>I guess in this case, it&#8217;s similar to using these other ugly things&#8230;</p>
<p># easily disable a block by changing one character.<br />
if 0:<br />
    do_stuff()</p>
<p>if 1:<br />
    do_stuff()</p>
<p>// allow putting more than one thing in the if/else blocks&#8230;<br />
//     if you need to later.<br />
//     Since C doesn&#8217;t require {} for single statements.<br />
if(some_condition) {<br />
    do_one_thing()<br />
} else {<br />
    do_one_thing()<br />
}</p>
<p>Leaving ugly stuff like that in production code, lets you try and fix things quicker if needed.</p>
<p>cu,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mpirnat</title>
		<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/comment-page-1/#comment-341</link>
		<dc:creator>mpirnat</dc:creator>
		<pubDate>Wed, 06 May 2009 20:43:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.pirnat.com/mike/?p=1132#comment-341</guid>
		<description>&lt;a href=&quot;#comment-340&quot; rel=&quot;nofollow&quot;&gt;@Christian Wyglendowski&lt;/a&gt; 
Instead of the &quot;none shall pass&quot; Black Knight, I&#039;m more envisioning Gandalf the Grey catching exceptions at the Bridge of Khazad-Dum, declaring &quot;You *cannot* pass!&quot;</description>
		<content:encoded><![CDATA[<p><a href="#comment-340" rel="nofollow">@Christian Wyglendowski</a><br />
Instead of the &#8220;none shall pass&#8221; Black Knight, I&#8217;m more envisioning Gandalf the Grey catching exceptions at the Bridge of Khazad-Dum, declaring &#8220;You *cannot* pass!&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Wyglendowski</title>
		<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/comment-page-1/#comment-340</link>
		<dc:creator>Christian Wyglendowski</dc:creator>
		<pubDate>Wed, 06 May 2009 20:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.pirnat.com/mike/?p=1132#comment-340</guid>
		<description>I love the inclusion of the &#039;pass&#039; statement as well.  It just teases the program, letting it see that it is only one statement away from blissfully continuing on in ignorance of all errors.  &quot;None shall pass!&quot;</description>
		<content:encoded><![CDATA[<p>I love the inclusion of the &#8216;pass&#8217; statement as well.  It just teases the program, letting it see that it is only one statement away from blissfully continuing on in ignorance of all errors.  &#8220;None shall pass!&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://www.pirnat.com/mike/2009/05/06/the-zen-of-doing-it-wrong/comment-page-1/#comment-339</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Wed, 06 May 2009 20:02:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.pirnat.com/mike/?p=1132#comment-339</guid>
		<description>I don&#039;t know who coined the phrase, but Mike Robellard and I used the phrase &quot;diaper pattern&quot; a lot when we were working on the CRT system.

I still use the phrase today; mostly when I catch way-too-broad except clauses.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know who coined the phrase, but Mike Robellard and I used the phrase &#8220;diaper pattern&#8221; a lot when we were working on the CRT system.</p>
<p>I still use the phrase today; mostly when I catch way-too-broad except clauses.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
