<?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: do { &#8230; } while (false);</title>
	<atom:link href="http://blog.slickedit.com/2007/05/do-while-false/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.slickedit.com/2007/05/do-while-false/</link>
	<description>&#34;Hello World&#34; - The SlickEdit Developer Blog</description>
	<lastBuildDate>Tue, 27 Jul 2010 22:28:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: steve</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-1018</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Wed, 20 Jan 2010 19:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-1018</guid>
		<description>This is substituting do-while for goto.  Just use goto and be done with it.</description>
		<content:encoded><![CDATA[<p>This is substituting do-while for goto.  Just use goto and be done with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neil</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-246</link>
		<dc:creator>neil</dc:creator>
		<pubDate>Sun, 09 Dec 2007 08:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-246</guid>
		<description>if(dofirst() &amp;&amp; dosecond() &amp;&amp; dolast(){}</description>
		<content:encoded><![CDATA[<p>if(dofirst() &amp;&amp; dosecond() &amp;&amp; dolast(){}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neil</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-245</link>
		<dc:creator>neil</dc:creator>
		<pubDate>Sun, 09 Dec 2007 08:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-245</guid>
		<description>if(dofirst() &amp;&amp; dosecond() &amp;&amp; dolast(){}

hmm 
one line 
no status variable 
same result</description>
		<content:encoded><![CDATA[<p>if(dofirst() &amp;&amp; dosecond() &amp;&amp; dolast(){}</p>
<p>hmm<br />
one line<br />
no status variable<br />
same result</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-31</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Mon, 14 May 2007 22:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-31</guid>
		<description>Some of you are addressing an error handling arrangement (IMO misguided) as if it were a preprocessor construct that makes multi-line macros safe for all invocations(IMO very useful, although I don&#039;t like multi-line macros unless I really have no choice due to the language).  They are two very different applications of a construct that appears on the surface to be the same thing.</description>
		<content:encoded><![CDATA[<p>Some of you are addressing an error handling arrangement (IMO misguided) as if it were a preprocessor construct that makes multi-line macros safe for all invocations(IMO very useful, although I don&#8217;t like multi-line macros unless I really have no choice due to the language).  They are two very different applications of a construct that appears on the surface to be the same thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-30</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 14 May 2007 16:25:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-30</guid>
		<description>I believe I first encountered the do{/*...*/}while(0) construct here:
http://c-faq.com/cpp/multistmt.html</description>
		<content:encoded><![CDATA[<p>I believe I first encountered the do{/*&#8230;*/}while(0) construct here:<br />
<a href="http://c-faq.com/cpp/multistmt.html" rel="nofollow">http://c-faq.com/cpp/multistmt.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ferdhie</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-28</link>
		<dc:creator>ferdhie</dc:creator>
		<pubDate>Sun, 13 May 2007 07:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-28</guid>
		<description>lovely tricks, and make code more cleaner instead of the horrible nested if, thanks for sharing</description>
		<content:encoded><![CDATA[<p>lovely tricks, and make code more cleaner instead of the horrible nested if, thanks for sharing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jc</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-27</link>
		<dc:creator>jc</dc:creator>
		<pubDate>Fri, 11 May 2007 18:06:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-27</guid>
		<description>Hah... saw this on dzone and just assumed it was java code. If this is C... then more power to ya.

Just dont be doing this in C# and Java! =)</description>
		<content:encoded><![CDATA[<p>Hah&#8230; saw this on dzone and just assumed it was java code. If this is C&#8230; then more power to ya.</p>
<p>Just dont be doing this in C# and Java! =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jc</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-26</link>
		<dc:creator>jc</dc:creator>
		<pubDate>Fri, 11 May 2007 18:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-26</guid>
		<description>Terrible, terrible, premature optimization.

Please... you really want to mess with stable and understood ideas such as exception handling? I&#039;ve written this same code in C many many years ago, and I dont believe there&#039;s a compelling reason to go back (even if it is to save a few cpu cycles).</description>
		<content:encoded><![CDATA[<p>Terrible, terrible, premature optimization.</p>
<p>Please&#8230; you really want to mess with stable and understood ideas such as exception handling? I&#8217;ve written this same code in C many many years ago, and I dont believe there&#8217;s a compelling reason to go back (even if it is to save a few cpu cycles).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-25</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Fri, 11 May 2007 17:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-25</guid>
		<description>You could always use labeled breaks --
        out: {
            status = doSomething();
            if (status) break out;            
            status = doSomethingElse();
            if (status) break out;
            
            status = doWhatYouWant();
        }</description>
		<content:encoded><![CDATA[<p>You could always use labeled breaks &#8211;<br />
        out: {<br />
            status = doSomething();<br />
            if (status) break out;<br />
            status = doSomethingElse();<br />
            if (status) break out;</p>
<p>            status = doWhatYouWant();<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: B. K. Oxley (binkley)</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-24</link>
		<dc:creator>B. K. Oxley (binkley)</dc:creator>
		<pubDate>Fri, 11 May 2007 15:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-24</guid>
		<description>Welcome to &quot;C&quot; programming.

The standard macro is illustrated in http://en.wikipedia.org/wiki/C_preprocessor#Multiple_statements and widely used in well-written macros.</description>
		<content:encoded><![CDATA[<p>Welcome to &#8220;C&#8221; programming.</p>
<p>The standard macro is illustrated in <a href="http://en.wikipedia.org/wiki/C_preprocessor#Multiple_statements" rel="nofollow">http://en.wikipedia.org/wiki/C_preprocessor#Multiple_statements</a> and widely used in well-written macros.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kohei Yoshida</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-22</link>
		<dc:creator>Kohei Yoshida</dc:creator>
		<pubDate>Fri, 11 May 2007 14:13:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-22</guid>
		<description>I would love to start using this idiom to replace code that looks like this:

&lt;a href=&quot;http://go-oo.org/lxr/source/sc/sc/source/filter/xml/xmlimprt.cxx#2540&quot; rel=&quot;nofollow&quot;&gt;http://go-oo.org/lxr/source/sc/sc/source/filter/xml/xmlimprt.cxx#2540&lt;/a&gt;

In the code base I now work on, there is a plenty of over-nested if-statement blocks like this one above.  In fact, that one is not bad in comparison to some of the worse ones I&#039;ve encountered.

Thanks for the good piece, Dennis!</description>
		<content:encoded><![CDATA[<p>I would love to start using this idiom to replace code that looks like this:</p>
<p><a href="http://go-oo.org/lxr/source/sc/sc/source/filter/xml/xmlimprt.cxx#2540" rel="nofollow">http://go-oo.org/lxr/source/sc/sc/source/filter/xml/xmlimprt.cxx#2540</a></p>
<p>In the code base I now work on, there is a plenty of over-nested if-statement blocks like this one above.  In fact, that one is not bad in comparison to some of the worse ones I&#8217;ve encountered.</p>
<p>Thanks for the good piece, Dennis!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis B</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-21</link>
		<dc:creator>Dennis B</dc:creator>
		<pubDate>Fri, 11 May 2007 13:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-21</guid>
		<description>The reason that multiple exit points can be a problem goes back to the original assumptions: that there is &lt;b&gt;cleanup code&lt;/b&gt; that needs to be executed before returning.  Yes, you could cut and paste the cleanup code.  I&#039;ve seen plenty of code like that and plenty of bugs and memory leaks that stemmed from inconsistent cleanup paths.</description>
		<content:encoded><![CDATA[<p>The reason that multiple exit points can be a problem goes back to the original assumptions: that there is <b>cleanup code</b> that needs to be executed before returning.  Yes, you could cut and paste the cleanup code.  I&#8217;ve seen plenty of code like that and plenty of bugs and memory leaks that stemmed from inconsistent cleanup paths.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Desbois</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-20</link>
		<dc:creator>Rob Desbois</dc:creator>
		<pubDate>Fri, 11 May 2007 12:54:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-20</guid>
		<description>John I agree that the code is readable and maintainable, and I understand the reasoning behind the usage of the loop, but I disagree that multiple exit points are inherently bad - can you given a reason why?

If the condition on line X of a function being true prevents the remainder of the function from being executed and causes &#039;3&#039; to be returned, it should read like that:

&lt;code&gt;
int f()
{
   int status = 0;
   if (condition1)
      status = 1;
   else if (condition2)
      status = 2;
   else
      status = f2();

   return status;
}


int g()
{
   if (condition1)
      return 1;

   if (condition2)
      return 2;

   return f2();
}
&lt;/code&gt;

The second function clearly shows that condition1 being true results in 1 being returned and no more code being executed.
To obtain the same insight into the first function you must read through the if..else.. structure, and check any code after it - simple in these contrived examples but in real code it can be harder.

Now, if we are in an environment where RAII cannot easily be applied - e.g. C - then continuing through the function until cleanup is necessary, but the second example shows far more easily what it is than the first.</description>
		<content:encoded><![CDATA[<p>John I agree that the code is readable and maintainable, and I understand the reasoning behind the usage of the loop, but I disagree that multiple exit points are inherently bad &#8211; can you given a reason why?</p>
<p>If the condition on line X of a function being true prevents the remainder of the function from being executed and causes &#8216;3&#8242; to be returned, it should read like that:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">int f()<br />
{<br />
&nbsp; &nbsp;int status = 0;<br />
&nbsp; &nbsp;if (condition1)<br />
&nbsp; &nbsp; &nbsp; status = 1;<br />
&nbsp; &nbsp;else if (condition2)<br />
&nbsp; &nbsp; &nbsp; status = 2;<br />
&nbsp; &nbsp;else<br />
&nbsp; &nbsp; &nbsp; status = f2();<br />
<br />
&nbsp; &nbsp;return status;<br />
}<br />
<br />
<br />
int g()<br />
{<br />
&nbsp; &nbsp;if (condition1)<br />
&nbsp; &nbsp; &nbsp; return 1;<br />
<br />
&nbsp; &nbsp;if (condition2)<br />
&nbsp; &nbsp; &nbsp; return 2;<br />
<br />
&nbsp; &nbsp;return f2();<br />
}</div></td></tr></tbody></table></div>
<p>The second function clearly shows that condition1 being true results in 1 being returned and no more code being executed.<br />
To obtain the same insight into the first function you must read through the if..else.. structure, and check any code after it &#8211; simple in these contrived examples but in real code it can be harder.</p>
<p>Now, if we are in an environment where RAII cannot easily be applied &#8211; e.g. C &#8211; then continuing through the function until cleanup is necessary, but the second example shows far more easily what it is than the first.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Doherty</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-18</link>
		<dc:creator>Julian Doherty</dc:creator>
		<pubDate>Fri, 11 May 2007 12:02:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-18</guid>
		<description>Another way of doing that would be like this:

boolean status = true;
status &amp;= doSomething();
status &amp;= doSomethingElse();
status &amp;= doWhatYouWantedToInTheFirstPlace();
return status;

(Works for Java anyway, my memory of C logic operators is a little hazy)</description>
		<content:encoded><![CDATA[<p>Another way of doing that would be like this:</p>
<p>boolean status = true;<br />
status &amp;= doSomething();<br />
status &amp;= doSomethingElse();<br />
status &amp;= doWhatYouWantedToInTheFirstPlace();<br />
return status;</p>
<p>(Works for Java anyway, my memory of C logic operators is a little hazy)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John DeHope</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-17</link>
		<dc:creator>John DeHope</dc:creator>
		<pubDate>Fri, 11 May 2007 12:02:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-17</guid>
		<description>the code is actually very clear, readable, and maintainable.&lt;/blockquote&gt; I disagree. You are using a loop as if it were a series of &lt;code&gt;if&lt;/code&gt; statements. That&#039;s clear to you? As anonymous said, multiple exit points are always a sign that you need to think twice. &lt;code&gt;If-else&lt;/code&gt; statements are not your enemy, there is no reason to avoid them. If you are writing branching code, then avoiding them seems pathological to me. That&#039;s &lt;i&gt;why&lt;/i&gt; they exist!</description>
		<content:encoded><![CDATA[<p>the code is actually very clear, readable, and maintainable. I disagree. You are using a loop as if it were a series of</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">if</div></td></tr></tbody></table></div>
<p>statements. That&#8217;s clear to you? As anonymous said, multiple exit points are always a sign that you need to think twice.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">If-else</div></td></tr></tbody></table></div>
<p>statements are not your enemy, there is no reason to avoid them. If you are writing branching code, then avoiding them seems pathological to me. That&#8217;s <i>why</i> they exist!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Desbois</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-16</link>
		<dc:creator>Rob Desbois</dc:creator>
		<pubDate>Fri, 11 May 2007 11:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-16</guid>
		<description>#5: why only have one exit point? How is it more readable to keep track of return code through a whole function having to nest a lot of code just so the only return point is the last line of the function?

IMHO the &#039;flatter&#039; (i.e. less nested) a function is, the more readable it is. If the execution of line #3 of a 20 line function results in none of the rest of the function being executed, it is easier to read if it states that *explicitly* by using the &#039;return&#039; keyword. It&#039;s similar to the exception&#039;s &#039;fail-fast&#039; mechanism

My opinion only, but I feel strongly on this one...out of interest why do you believe multiple exit points make a function more readable?</description>
		<content:encoded><![CDATA[<p>#5: why only have one exit point? How is it more readable to keep track of return code through a whole function having to nest a lot of code just so the only return point is the last line of the function?</p>
<p>IMHO the &#8216;flatter&#8217; (i.e. less nested) a function is, the more readable it is. If the execution of line #3 of a 20 line function results in none of the rest of the function being executed, it is easier to read if it states that *explicitly* by using the &#8216;return&#8217; keyword. It&#8217;s similar to the exception&#8217;s &#8216;fail-fast&#8217; mechanism</p>
<p>My opinion only, but I feel strongly on this one&#8230;out of interest why do you believe multiple exit points make a function more readable?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-15</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 11 May 2007 11:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-15</guid>
		<description>Multiple exit points are a code smell.  Code readability is more important, IMO, than heuristic performance enhancements.</description>
		<content:encoded><![CDATA[<p>Multiple exit points are a code smell.  Code readability is more important, IMO, than heuristic performance enhancements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Desbois</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-14</link>
		<dc:creator>Rob Desbois</dc:creator>
		<pubDate>Fri, 11 May 2007 11:18:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-14</guid>
		<description>Have to say I dislike this syntax. If the status code was some sort of error at any point, an exception should be thrown if the language allows.

If the language does not allow, or the status is not an error it would be far more appropriate to wrap the whole thing in a function and use return:


function doTheThing()
{
   // preconditions
   int status = doSomething();
   if (status)
      return status;

   status = doSomethingElse();
   if (status)
      return status;

   // computation
   return doWhatYouWantedToInTheFirstPlace();
}


It makes the exit points from the function far more readable, and reduces nesting.</description>
		<content:encoded><![CDATA[<p>Have to say I dislike this syntax. If the status code was some sort of error at any point, an exception should be thrown if the language allows.</p>
<p>If the language does not allow, or the status is not an error it would be far more appropriate to wrap the whole thing in a function and use return:</p>
<p>function doTheThing()<br />
{<br />
   // preconditions<br />
   int status = doSomething();<br />
   if (status)<br />
      return status;</p>
<p>   status = doSomethingElse();<br />
   if (status)<br />
      return status;</p>
<p>   // computation<br />
   return doWhatYouWantedToInTheFirstPlace();<br />
}</p>
<p>It makes the exit points from the function far more readable, and reduces nesting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abdul Habra</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-11</link>
		<dc:creator>Abdul Habra</dc:creator>
		<pubDate>Thu, 10 May 2007 18:19:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-11</guid>
		<description>Another approach that I use is to break this into two methods. something like this:

int m1() {
   int status = 0; 
   // preconditions
   status = doSomething();
   if (status) return status;

   status = doSomethingElse();
   if (status) return status;

   // computation
   status = doWhatYouWantedToInTheFirstPlace();
   return status;
}

void m2() {
  int status= m1();
  if (status) {
    // cleanup
  }
}</description>
		<content:encoded><![CDATA[<p>Another approach that I use is to break this into two methods. something like this:</p>
<p>int m1() {<br />
   int status = 0;<br />
   // preconditions<br />
   status = doSomething();<br />
   if (status) return status;</p>
<p>   status = doSomethingElse();<br />
   if (status) return status;</p>
<p>   // computation<br />
   status = doWhatYouWantedToInTheFirstPlace();<br />
   return status;<br />
}</p>
<p>void m2() {<br />
  int status= m1();<br />
  if (status) {<br />
    // cleanup<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-10</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Thu, 10 May 2007 18:15:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-10</guid>
		<description>You still need the status, unless you are going to put the calls in the if condition.

status = DoSomething();
if(!status)
{
   status = DoSomethingElse();
}
if(!status)
{
   status = DoWhatYouWantedToInTheFirstPlace();
}</description>
		<content:encoded><![CDATA[<p>You still need the status, unless you are going to put the calls in the if condition.</p>
<p>status = DoSomething();<br />
if(!status)<br />
{<br />
   status = DoSomethingElse();<br />
}<br />
if(!status)<br />
{<br />
   status = DoWhatYouWantedToInTheFirstPlace();<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noname</title>
		<link>http://blog.slickedit.com/2007/05/do-while-false/comment-page-1/#comment-9</link>
		<dc:creator>Noname</dc:creator>
		<pubDate>Thu, 10 May 2007 18:04:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slickedit.com/?p=67#comment-9</guid>
		<description>I do the same with a goto statement.  Don&#039;t freak out, you can use goto responsibly.  You don&#039;t need an extra variable, or a confusing &lt;b&gt;do{...}while(false)&lt;/b&gt; statement.  Everything unwinds nicely at the end of the function.  It just works well, I probably wouldn&#039;t use this do while thing at all.  It&#039;s functionally the same as the goto method and requires an extra variable, plus another control structure to interpret that variable.</description>
		<content:encoded><![CDATA[<p>I do the same with a goto statement.  Don&#8217;t freak out, you can use goto responsibly.  You don&#8217;t need an extra variable, or a confusing <b>do{&#8230;}while(false)</b> statement.  Everything unwinds nicely at the end of the function.  It just works well, I probably wouldn&#8217;t use this do while thing at all.  It&#8217;s functionally the same as the goto method and requires an extra variable, plus another control structure to interpret that variable.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
