<?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"
	>
<channel>
	<title>Comments on: What&#8217;s in a Label</title>
	<atom:link href="http://awads.net/wp/2006/02/16/whats-in-a-label/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2006/02/16/whats-in-a-label/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<pubDate>Fri, 08 Aug 2008 20:06:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1385</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Fri, 17 Feb 2006 20:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1385</guid>
		<description>&lt;p&gt;&lt;i&gt;APC: I was merely pointing out that raising an exception is a special case of GOTO.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Ah! I see. when you raise an exception, you basically "go to" the corresponding exception block.&lt;/p&gt;

&lt;p&gt;&lt;i&gt;APC: Before I started in Oracle I worked on a particular flavour of COBOL that didn't support conditional ERFORMs. GOTOs were a way of life.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;I started my programming career with COBOL, that was in 1992. COBOL and GOTO were best buddies.&lt;/p&gt;

&lt;p&gt;In PL/SQL, I just cannot see a real need to use labels and GOTO's. Labels can be easily replaced with comments. GOTO's can be easily replaced with many other programming controls that provide a much better clarity to the program logic.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i>APC: I was merely pointing out that raising an exception is a special case of GOTO.</i></p>
<p>Ah! I see. when you raise an exception, you basically &#8220;go to&#8221; the corresponding exception block.</p>
<p><i>APC: Before I started in Oracle I worked on a particular flavour of COBOL that didn&#8217;t support conditional ERFORMs. GOTOs were a way of life.</i></p>
<p>I started my programming career with COBOL, that was in 1992. COBOL and GOTO were best buddies.</p>
<p>In PL/SQL, I just cannot see a real need to use labels and GOTO&#8217;s. Labels can be easily replaced with comments. GOTO&#8217;s can be easily replaced with many other programming controls that provide a much better clarity to the program logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FranÃ§ois Degrelle</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1377</link>
		<dc:creator>FranÃ§ois Degrelle</dc:creator>
		<pubDate>Fri, 17 Feb 2006 13:14:55 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1377</guid>
		<description>&lt;p&gt;Label could be an elegant solution to exit 2 nested loop&lt;/p&gt;

&lt;pre&gt;
SQL&#62; Declare
  2    LN$I pls_integer := 0 ;
  3    LN$J pls_integer := 0 ;
  4  Begin
  5    &#60;&#60;boucle1&#62;&#62;
  6    Loop
  7      LN$I := LN$I + 1 ;
  8      Loop
  9         LN$J := LN$J + 1 ;
 10         dbms_output.put_line( to_char( LN$I ) &#124;&#124; ',' &#124;&#124; to_char( LN$J ) ) ;
 11         EXIT boucle1 WHEN LN$J &#62; 3 ;
 12      End loop ;
 13    End loop ;
 14  End ;
 15  /
1,1
1,2
1,3
1,4

ProcÃ©dure PL/SQL terminÃ©e avec succÃ¨s.
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Label could be an elegant solution to exit 2 nested loop</p>
<pre>
SQL&gt; Declare
  2    LN$I pls_integer := 0 ;
  3    LN$J pls_integer := 0 ;
  4  Begin
  5    &lt;&lt;boucle1&gt;&gt;
  6    Loop
  7      LN$I := LN$I + 1 ;
  8      Loop
  9         LN$J := LN$J + 1 ;
 10         dbms_output.put_line( to_char( LN$I ) || ',' || to_char( LN$J ) ) ;
 11         EXIT boucle1 WHEN LN$J &gt; 3 ;
 12      End loop ;
 13    End loop ;
 14  End ;
 15  /
1,1
1,2
1,3
1,4

ProcÃ©dure PL/SQL terminÃ©e avec succÃ¨s.
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1376</link>
		<dc:creator>Krishna</dc:creator>
		<pubDate>Fri, 17 Feb 2006 12:33:14 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1376</guid>
		<description>&lt;p&gt;[OT] &lt;i&gt;I don't think Dijkstra has revoked his fatwa. &lt;/i&gt;&lt;/p&gt;

&lt;p&gt;I don't think he will ever be able to revoke it given that he passed away few years back :(&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[OT] <i>I don&#8217;t think Dijkstra has revoked his fatwa. </i></p>
<p>I don&#8217;t think he will ever be able to revoke it given that he passed away few years back <img src='http://awads.net/wp/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: APC</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1373</link>
		<dc:creator>APC</dc:creator>
		<pubDate>Fri, 17 Feb 2006 09:45:47 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1373</guid>
		<description>
  
    
      &lt;p&gt;And what's wrong with GOTOs anyway? haven't they been officially considered not harmful for sometime now?&lt;/p&gt;
    
  
  
  &lt;p&gt;They have? Nobody tells me anything.&lt;/p&gt;


&lt;p&gt;Actually I was thinking about the NTK newsletter and not some computer science pronouncement.  I don't think Dijkstra has revoked his fatwa.   Still, if you've ever had to follow the possible paths through a function that has over a dozen RETURN statements you might find yourself pining for a nice GOTO exit_point.&lt;/p&gt;

&lt;p&gt;GOTOs are like triggers: there's nothing inherently wrong with the construct, it's simply the potential for abuse that renders their use suspect.  Simply avoiding the use of GOTO statement does not make our code  well-structured.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>And what&#8217;s wrong with GOTOs anyway? haven&#8217;t they been officially considered not harmful for sometime now?</p>
<p>They have? Nobody tells me anything.</p>
<p>Actually I was thinking about the NTK newsletter and not some computer science pronouncement.  I don&#8217;t think Dijkstra has revoked his fatwa.   Still, if you&#8217;ve ever had to follow the possible paths through a function that has over a dozen RETURN statements you might find yourself pining for a nice GOTO exit_point.</p>
<p>GOTOs are like triggers: there&#8217;s nothing inherently wrong with the construct, it&#8217;s simply the potential for abuse that renders their use suspect.  Simply avoiding the use of GOTO statement does not make our code  well-structured.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: APC</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1372</link>
		<dc:creator>APC</dc:creator>
		<pubDate>Fri, 17 Feb 2006 09:33:40 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1372</guid>
		<description>
  
    &lt;p&gt;I take it you use GOTO to raise exceptions&lt;/p&gt;
  


&lt;p&gt;Of course not.  I was merely pointing out that raising an exception is a special case of GOTO.  Particularly given a case like this:&lt;/p&gt;

&lt;pre&gt;
    ....
    do_something_a;
    do_something_b;
EXCEPTION
   WHEN others THEN blah;
&lt;/pre&gt;

&lt;p&gt;If do_something_a raises an exception to be handle by the calling program then essentially there is an invisible GOTO that bypasses do_something_b.&lt;/p&gt;

&lt;p&gt;Before I started in Oracle I worked on a particular flavour of COBOL that didn't support conditional ERFORMs.  GOTOs were a way of life.  So I know bad use of GOTO create spaghetti code.  I also know that well structured GOTOs have their place.&lt;/p&gt;

&lt;p&gt;Of course, Oracle PL/SQL has a panoply of control structures and I have never had to use a GOTO since I stopped COBOLing.  Indeed the other day I found myself with a LOOP that had more than one EXIT statement and felt unclean.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I take it you use GOTO to raise exceptions</p>
<p>Of course not.  I was merely pointing out that raising an exception is a special case of GOTO.  Particularly given a case like this:</p>
<pre>
    ....
    do_something_a;
    do_something_b;
EXCEPTION
   WHEN others THEN blah;
</pre>
<p>If do_something_a raises an exception to be handle by the calling program then essentially there is an invisible GOTO that bypasses do_something_b.</p>
<p>Before I started in Oracle I worked on a particular flavour of COBOL that didn&#8217;t support conditional ERFORMs.  GOTOs were a way of life.  So I know bad use of GOTO create spaghetti code.  I also know that well structured GOTOs have their place.</p>
<p>Of course, Oracle PL/SQL has a panoply of control structures and I have never had to use a GOTO since I stopped COBOLing.  Indeed the other day I found myself with a LOOP that had more than one EXIT statement and felt unclean.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom_Fox</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1369</link>
		<dc:creator>Tom_Fox</dc:creator>
		<pubDate>Thu, 16 Feb 2006 20:50:10 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1369</guid>
		<description>&lt;p&gt;I'm not a developer, but the term GOTO reminds me of writing BASIC on my Commodore 64.  I can't believe it still exists, besides in Windows batch files.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;m not a developer, but the term GOTO reminds me of writing BASIC on my Commodore 64.  I can&#8217;t believe it still exists, besides in Windows batch files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1368</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Thu, 16 Feb 2006 19:19:42 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1368</guid>
		<description>&lt;p&gt;&lt;i&gt;I take it you never raise exceptions either&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;I take it you use GOTO to raise exceptions ;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i>I take it you never raise exceptions either</i></p>
<p>I take it you use GOTO to raise exceptions <img src='http://awads.net/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William Robertson</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1367</link>
		<dc:creator>William Robertson</dc:creator>
		<pubDate>Thu, 16 Feb 2006 17:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1367</guid>
		<description>&lt;p&gt;&lt;i&gt;&#62; And what's wrong with GOTOs anyway? haven't they been officially considered not harmful for sometime now?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;They have? Nobody tells me anything.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i>&gt; And what&#8217;s wrong with GOTOs anyway? haven&#8217;t they been officially considered not harmful for sometime now?</i></p>
<p>They have? Nobody tells me anything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Hall</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1366</link>
		<dc:creator>Tim Hall</dc:creator>
		<pubDate>Thu, 16 Feb 2006 16:23:50 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1366</guid>
		<description>&lt;p&gt;I don't use GOTOs, but I do use labels for loops sometimes. It's really a clarity thing. If I have nested loops, the labels are handy to see which loop has ended, although a comment would do the same. I also use labels if I'm planning to exit a loop prematurely.&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;

&lt;p&gt;Tim...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I don&#8217;t use GOTOs, but I do use labels for loops sometimes. It&#8217;s really a clarity thing. If I have nested loops, the labels are handy to see which loop has ended, although a comment would do the same. I also use labels if I&#8217;m planning to exit a loop prematurely.</p>
<p>Cheers</p>
<p>Tim&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Lorenzen</title>
		<link>http://awads.net/wp/2006/02/16/whats-in-a-label/#comment-1365</link>
		<dc:creator>Peter Lorenzen</dc:creator>
		<pubDate>Thu, 16 Feb 2006 16:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=218#comment-1365</guid>
		<description>&lt;p&gt;I use labels in 3 situations: Loops, case statement and begin end block inside a procedure/function. I like that you can end the case or the begin with a label like this:&lt;/p&gt;

&lt;pre&gt;
&#60;&#60;myBlock&#62;&#62;
begin
  x := y + 1;
end myBlock;
&lt;/pre&gt;

&lt;pre&gt;
&#60;&#60;myCase&#62;&#62;
case xx
  when ..
end case myCase;
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>I use labels in 3 situations: Loops, case statement and begin end block inside a procedure/function. I like that you can end the case or the begin with a label like this:</p>
<pre>
&lt;&lt;myBlock&gt;&gt;
begin
  x := y + 1;
end myBlock;
</pre>
<pre>
&lt;&lt;myCase&gt;&gt;
case xx
  when ..
end case myCase;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
