<?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: Continuations and Exceptions</title>
	<atom:link href="http://www.hackinghat.com/index.php/java/continuations-and-exceptions/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hackinghat.com/index.php/java/continuations-and-exceptions</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 14:27:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Brock</title>
		<link>http://www.hackinghat.com/index.php/java/continuations-and-exceptions/comment-page-1#comment-1360</link>
		<dc:creator>Brock</dc:creator>
		<pubDate>Fri, 26 Oct 2007 20:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/java/continuations-and-exceptions#comment-1360</guid>
		<description>Regarding continuations in web programming making it more difficult to follow the flow of the application, I think it&#039;s quite the opposite. The idea with using continuations is to keep the code flowing linearly, instead of having a big CASE statement at the top of your application which then does a GOTO the next part of the program.

I cite Perl&#039;s Continuity library (of which I am the author and thus am quite biased towards), I can write:


  my $a = prompt(&quot;Enter a number&quot;);
  my $b = prompt(&quot;Enter another number&quot;);
  display(&quot;The sum of $a and $b is &quot; . ($a + $b));


Where each call to &quot;prompt&quot; displays an appropriate prompt page, waits for input, and then returns the result. If you were to write this simple program in a traditional way you&#039;d quite likely keep some sort of a &quot;current_step&quot; variable which indicated if we were asking for the first number, asking for the second, or displaying the third. Each step would indicate what the next step of the application is supposed to be, thereby implementing an ad-hoc state machine.

Scalability, however, is definately an issue :)

(email me if you want the complete source code for this example, awwaiid@thelackthereof.org).</description>
		<content:encoded><![CDATA[<p>Regarding continuations in web programming making it more difficult to follow the flow of the application, I think it&#8217;s quite the opposite. The idea with using continuations is to keep the code flowing linearly, instead of having a big CASE statement at the top of your application which then does a GOTO the next part of the program.</p>
<p>I cite Perl&#8217;s Continuity library (of which I am the author and thus am quite biased towards), I can write:</p>
<p>  my $a = prompt(&#8220;Enter a number&#8221;);<br />
  my $b = prompt(&#8220;Enter another number&#8221;);<br />
  display(&#8220;The sum of $a and $b is &#8221; . ($a + $b));</p>
<p>Where each call to &#8220;prompt&#8221; displays an appropriate prompt page, waits for input, and then returns the result. If you were to write this simple program in a traditional way you&#8217;d quite likely keep some sort of a &#8220;current_step&#8221; variable which indicated if we were asking for the first number, asking for the second, or displaying the third. Each step would indicate what the next step of the application is supposed to be, thereby implementing an ad-hoc state machine.</p>
<p>Scalability, however, is definately an issue <img src='http://www.hackinghat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(email me if you want the complete source code for this example, <a href="mailto:awwaiid@thelackthereof.org">awwaiid@thelackthereof.org</a>).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

