<?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 Javascript goto statement</title>
	<atom:link href="http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/</link>
	<description>web / programming / javascript / css / html</description>
	<lastBuildDate>Tue, 29 Jun 2010 15:30:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: gene</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-6561</link>
		<dc:creator>gene</dc:creator>
		<pubDate>Sat, 29 Nov 2008 22:53:39 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-6561</guid>
		<description>I realize this is an old post - but its been a year, and now (in FF at least)

we have iterator expressions and &quot;yield&quot; statements inside iterators! 

Ive also found myself in a lot of cases where I use var hasSomethingBeenFoundYet = false;

I feel like it actually makes the code more complicated, especially when there are multiple exit conditions or checks. 

var hasSomethingElseBeenFoundYet = false;

if(hasSomethingElseBeenFoundYet &amp;&amp; hasSomethingBeenFoundYet) return &#039;found both&#039;;</description>
		<content:encoded><![CDATA[<p>I realize this is an old post &#8211; but its been a year, and now (in FF at least)</p>
<p>we have iterator expressions and &#034;yield&#034; statements inside iterators! </p>
<p>Ive also found myself in a lot of cases where I use var hasSomethingBeenFoundYet = false;</p>
<p>I feel like it actually makes the code more complicated, especially when there are multiple exit conditions or checks. </p>
<p>var hasSomethingElseBeenFoundYet = false;</p>
<p>if(hasSomethingElseBeenFoundYet &amp;&amp; hasSomethingBeenFoundYet) return &#039;found both&#039;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Taylor</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-1322</link>
		<dc:creator>Rick Taylor</dc:creator>
		<pubDate>Thu, 29 May 2008 20:51:27 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-1322</guid>
		<description>I agree with using a label to branch out of code that need not to be executed.

The goto label way back in the Cobol days was being misused and therefore &quot;Spaghetti Code&quot; was invented.   These programms were very difficult to trace, maintain and debug.

Using a Goto or label to branch out of loop processing or out of a function is good programming sense when used appropriately.</description>
		<content:encoded><![CDATA[<p>I agree with using a label to branch out of code that need not to be executed.</p>
<p>The goto label way back in the Cobol days was being misused and therefore &#034;Spaghetti Code&#034; was invented.   These programms were very difficult to trace, maintain and debug.</p>
<p>Using a Goto or label to branch out of loop processing or out of a function is good programming sense when used appropriately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-1216</link>
		<dc:creator>Gary</dc:creator>
		<pubDate>Tue, 08 Apr 2008 18:34:27 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-1216</guid>
		<description>Most people that I find that are against &#039;goto&#039; statements don&#039;t understand that the &#039;goto&#039; is a jump statement in machine language. All the loop structures (&#039;for&#039;, &#039;while&#039;, &#039;switch&#039;, etc...) are composed of jump statements. For that matter, function calls are composed jump statements. It is a fundamental tool of procedural programming and is very powerful. Many language features are abused by programmers, but the &#039;goto&#039; must not be deprecated because of poor usage.
Professor&#039;s are probably to blame for this &#039;evil&#039; concept. It&#039;s probably a nightmare reading student&#039;s code to begin with. I&#039;m sure &#039;goto&#039; statements sprinkled throughout their code doesn&#039;t help.</description>
		<content:encoded><![CDATA[<p>Most people that I find that are against &#039;goto&#039; statements don&#039;t understand that the &#039;goto&#039; is a jump statement in machine language. All the loop structures (&#039;for&#039;, &#039;while&#039;, &#039;switch&#039;, etc&#8230;) are composed of jump statements. For that matter, function calls are composed jump statements. It is a fundamental tool of procedural programming and is very powerful. Many language features are abused by programmers, but the &#039;goto&#039; must not be deprecated because of poor usage.<br />
Professor&#039;s are probably to blame for this &#039;evil&#039; concept. It&#039;s probably a nightmare reading student&#039;s code to begin with. I&#039;m sure &#039;goto&#039; statements sprinkled throughout their code doesn&#039;t help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sstchur</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-1173</link>
		<dc:creator>sstchur</dc:creator>
		<pubDate>Wed, 02 Apr 2008 04:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-1173</guid>
		<description>David,

&lt;p&gt;Do you have a source that documents a supported goto statement in Javascript?  At the time this post was written, there was no goto statement in ECMAScipt-262.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>Do you have a source that documents a supported goto statement in Javascript?  At the time this post was written, there was no goto statement in ECMAScipt-262.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-1171</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 02 Apr 2008 01:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-1171</guid>
		<description>Thanks for the info.  I did not know about labeled breaks and continue... thank you.  I did a little research and there appears to be a goto statement in JavaScript though.

~David</description>
		<content:encoded><![CDATA[<p>Thanks for the info.  I did not know about labeled breaks and continue&#8230; thank you.  I did a little research and there appears to be a goto statement in JavaScript though.</p>
<p>~David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Barry</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-1159</link>
		<dc:creator>Barry</dc:creator>
		<pubDate>Tue, 01 Apr 2008 01:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-1159</guid>
		<description>The continue; is listed in my JavaScript 1.2 book.  Not sure if it was available before this.</description>
		<content:encoded><![CDATA[<p>The continue; is listed in my JavaScript 1.2 book.  Not sure if it was available before this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: operatica</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-74</link>
		<dc:creator>operatica</dc:creator>
		<pubDate>Sat, 22 Dec 2007 21:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-74</guid>
		<description>I abhor gotos but I understand that at times things that are not best practices can be more efficient to use.  In your scenario, I think the continue was absolutely the best way to go because *it is more efficient* than using a boolean and affording the extra overhead for the additonal isEating() calls.  I fully agree that should the code need to grow to be more complex, it&#039;s possibly the design pattern of the continue could become unwelcome.  So, document as such somewhere, construct rudimentary prototype code for that situation, and leave it as being more efficient when it doesn&#039;t need to be more complex.</description>
		<content:encoded><![CDATA[<p>I abhor gotos but I understand that at times things that are not best practices can be more efficient to use.  In your scenario, I think the continue was absolutely the best way to go because *it is more efficient* than using a boolean and affording the extra overhead for the additonal isEating() calls.  I fully agree that should the code need to grow to be more complex, it&#039;s possibly the design pattern of the continue could become unwelcome.  So, document as such somewhere, construct rudimentary prototype code for that situation, and leave it as being more efficient when it doesn&#039;t need to be more complex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-73</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Sat, 20 Oct 2007 13:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-73</guid>
		<description>I agree - I started out with BASIC, so the goto function makes sense in a lot of cases... not *all* cases, but more than enough to not call it evil right off. Now, having started with BASIC, I&#039;ve only recently gotten into javascript and the lot of interactive languages, so while your example makes sense, how would you go about making it more complex?
i/e:
if(a==&quot;true&quot;) goto b
else goto a
if(b==&quot;true&quot;) goto c
etc...

No need to post this really, but a reply would be awesome.</description>
		<content:encoded><![CDATA[<p>I agree &#8211; I started out with BASIC, so the goto function makes sense in a lot of cases&#8230; not *all* cases, but more than enough to not call it evil right off. Now, having started with BASIC, I&#039;ve only recently gotten into javascript and the lot of interactive languages, so while your example makes sense, how would you go about making it more complex?<br />
i/e:<br />
if(a==&#034;true&#034;) goto b<br />
else goto a<br />
if(b==&#034;true&#034;) goto c<br />
etc&#8230;</p>
<p>No need to post this really, but a reply would be awesome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Boughton</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-72</link>
		<dc:creator>Bruce Boughton</dc:creator>
		<pubDate>Tue, 03 Apr 2007 23:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-72</guid>
		<description>I say: &lt;code&gt;continue usingLabelledContinue&lt;/code&gt; ;)

I think there&#039;s a general consesus to ignore some of a language&#039;s &quot;more advanced&quot; features because they&#039;re commonly used and therefore not always well known. To me, this is just dumbing down of programming; if we can educate others through our code, then so be it.</description>
		<content:encoded><![CDATA[<p>I say: <code>continue usingLabelledContinue</code> <img src='http://blog.stchur.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I think there&#039;s a general consesus to ignore some of a language&#039;s &#034;more advanced&#034; features because they&#039;re commonly used and therefore not always well known. To me, this is just dumbing down of programming; if we can educate others through our code, then so be it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim McCormack</title>
		<link>http://blog.stchur.com/2007/03/09/the-javascript-goto-statement/comment-page-1/#comment-71</link>
		<dc:creator>Tim McCormack</dc:creator>
		<pubDate>Tue, 03 Apr 2007 14:57:17 +0000</pubDate>
		<guid isPermaLink="false">http://stchur.com/blog2/2007/03/09/the-javascript-goto-statement/#comment-71</guid>
		<description>Yeah, &lt;code&gt;continue pastureLoop&lt;/code&gt; makes the most sense. No doubt about it.</description>
		<content:encoded><![CDATA[<p>Yeah, <code>continue pastureLoop</code> makes the most sense. No doubt about it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
