<?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: PHP to the Rescue!</title>
	<atom:link href="http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<pubDate>Thu, 04 Dec 2008 01:13:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: SitePoint Blogs &#187; How strict is your dynamic language?</title>
		<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/#comment-40789</link>
		<dc:creator>SitePoint Blogs &#187; How strict is your dynamic language?</dc:creator>
		<pubDate>Thu, 27 Jul 2006 09:56:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1521#comment-40789</guid>
		<description>[...] If anyone&#8217;s willing, would be interesting to compare the example with IO, Lua and Erlang, where possible (side note: I did get the point&#8212;just pressing the PHP buzzer for fun&#8212;fascinated to see what Damien comes up with in CouchDB, especially the part about &#8220;Distributed, featuring robust, incremental replication with bi-directional conflict detection and resolution.&#8221;). Tags: perl, php, ruby, python [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] If anyone&#8217;s willing, would be interesting to compare the example with IO, Lua and Erlang, where possible (side note: I did get the point&#8212;just pressing the PHP buzzer for fun&#8212;fascinated to see what Damien comes up with in CouchDB, especially the part about &#8220;Distributed, featuring robust, incremental replication with bi-directional conflict detection and resolution.&#8221;). Tags: perl, php, ruby, python [&#8230;]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: kapil</title>
		<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/#comment-35620</link>
		<dc:creator>kapil</dc:creator>
		<pubDate>Fri, 07 Jul 2006 06:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1521#comment-35620</guid>
		<description>h r u</description>
		<content:encoded><![CDATA[<p>h r u</p>]]></content:encoded>
	</item>
	<item>
		<title>By: shai8181</title>
		<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/#comment-21390</link>
		<dc:creator>shai8181</dc:creator>
		<pubDate>Mon, 01 May 2006 03:13:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1521#comment-21390</guid>
		<description>I’m sorry to say, but I think you missed the point of the article. It isn’t about php, and not about web programming either. It is about error recovery and functional programming.

He does point out cases where exceptions are more expressive (sure, error codes could be used too). And he mentions a few other methods.

You should read this article in a web programming context. It really is about general error recovery. He just compares the shared nothing architecture of PHP with functional programming, where every function is essentially shares nothing with other functions. 
</description>
		<content:encoded><![CDATA[<p>I’m sorry to say, but I think you missed the point of the article. It isn’t about php, and not about web programming either. It is about error recovery and functional programming.</p>
<p>He does point out cases where exceptions are more expressive (sure, error codes could be used too). And he mentions a few other methods.</p>
<p>You should read this article in a web programming context. It really is about general error recovery. He just compares the shared nothing architecture of PHP with functional programming, where every function is essentially shares nothing with other functions. </p>]]></content:encoded>
	</item>
	<item>
		<title>By: HarryF</title>
		<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/#comment-21353</link>
		<dc:creator>HarryF</dc:creator>
		<pubDate>Sun, 30 Apr 2006 21:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1521#comment-21353</guid>
		<description>&lt;blockquote&gt;
I don't get this. Is this implying that PHP is more mature in this matter than other web technologies. Because—quite frankly—that’s untrue. JSPs execute with no shared state. JSF, ASP.NET executes with no shared state. Tapestry executes with no shared state.

For all of the above web techs, once a page is rendered it’s state is gone. *Unless* the programmer explicitly chooses to store state in a “session”. And that’s true for PHP $_SESSION as well.
&lt;/blockquote&gt;

Think PHP was used by Damien by way of useful example to illustrate his point - as already commented the focus of Damien's article wasn't web programming (blame me for just pulling a quote out of context). It's more that people should think more in terms of transactions when programming (or use a functional programming language) - think the GUI example he uses perhaps illustrates this best;

&lt;blockquote&gt;
An example might be if you have GUI application, and your code wants to add a dockable tool bar to the UI window.

One approach is to add an empty tool bar to the UI, then add each individual button to the bar. This is wrong wrong wrong, because now you are mutating the UI program state for each button added, and if one tool bar button fails to be added, then the user gets a wacked-out, partially constructed bar. [...]

Instead, the better strategy is to build the tool bar in isolation. Once the bar is completely constructed with all buttons, then add it to the UI in a single operation. This way you minimize the mutation to the existing objects (the top level window), instead we are only mutating our new object during its multi-step construction. If we fail to construct it fully, we can just forget about it and let the garbage collection get it.
&lt;/blockquote&gt;

That said, if we &lt;em&gt;are&lt;/em&gt; focused on web programming, it's worth being aware that session state isn't the only place you can shoot yourself in the foot - most platforms, &lt;em&gt;except PHP&lt;/em&gt; offer you some kind of &lt;em&gt;application&lt;/em&gt; state (which you don't have to use of course), be it &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconapplicationstate.asp" rel="nofollow"&gt;explicit &lt;/a&gt; or just &lt;a href="http://www.onjava.com/pub/a/onjava/2004/07/14/clustering.html?page=last&#38;x-maxdepth=0" rel="nofollow"&gt;static variables&lt;/a&gt;. In fact it's the very notion of "application" which doesn't exist in PHP - that you might call a bunch of PHP scripts in a web directory an application is by the by - when one of them handles a request, it is blissfully unaware of the other scripts in the directory. There isn't some kind of startup phase with PHP, where a bunch of stuff get's loaded into memory.

&lt;blockquote&gt;
I’m sorry to say, but I think you missed the point of the article. It isn’t about php, and not about web programming either. It is about error recovery and functional programming.
&lt;/blockquote&gt;

On of the comments on Damien's page makes a point to that effect;

&lt;blockquote&gt;
[...] the title is misleading. The answer to "error codes" or "exceptions" is (correctly) "depends on the situation" ... but discussion on this is only a fraction of the article.
&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<blockquote><p>
I don&#8217;t get this. Is this implying that PHP is more mature in this matter than other web technologies. Because—quite frankly—that’s untrue. JSPs execute with no shared state. JSF, ASP.NET executes with no shared state. Tapestry executes with no shared state.</p>
<p>For all of the above web techs, once a page is rendered it’s state is gone. *Unless* the programmer explicitly chooses to store state in a “session”. And that’s true for PHP $_SESSION as well.
</p></blockquote>
<p>Think PHP was used by Damien by way of useful example to illustrate his point - as already commented the focus of Damien&#8217;s article wasn&#8217;t web programming (blame me for just pulling a quote out of context). It&#8217;s more that people should think more in terms of transactions when programming (or use a functional programming language) - think the GUI example he uses perhaps illustrates this best;</p>
<blockquote><p>
An example might be if you have GUI application, and your code wants to add a dockable tool bar to the UI window.</p>
<p>One approach is to add an empty tool bar to the UI, then add each individual button to the bar. This is wrong wrong wrong, because now you are mutating the UI program state for each button added, and if one tool bar button fails to be added, then the user gets a wacked-out, partially constructed bar. [&#8230;]</p>
<p>Instead, the better strategy is to build the tool bar in isolation. Once the bar is completely constructed with all buttons, then add it to the UI in a single operation. This way you minimize the mutation to the existing objects (the top level window), instead we are only mutating our new object during its multi-step construction. If we fail to construct it fully, we can just forget about it and let the garbage collection get it.
</p></blockquote>
<p>That said, if we <em>are</em> focused on web programming, it&#8217;s worth being aware that session state isn&#8217;t the only place you can shoot yourself in the foot - most platforms, <em>except PHP</em> offer you some kind of <em>application</em> state (which you don&#8217;t have to use of course), be it <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconapplicationstate.asp" rel="nofollow">explicit </a> or just <a href="http://www.onjava.com/pub/a/onjava/2004/07/14/clustering.html?page=last&amp;x-maxdepth=0" rel="nofollow">static variables</a>. In fact it&#8217;s the very notion of &#8220;application&#8221; which doesn&#8217;t exist in PHP - that you might call a bunch of PHP scripts in a web directory an application is by the by - when one of them handles a request, it is blissfully unaware of the other scripts in the directory. There isn&#8217;t some kind of startup phase with PHP, where a bunch of stuff get&#8217;s loaded into memory.</p>
<blockquote><p>
I’m sorry to say, but I think you missed the point of the article. It isn’t about php, and not about web programming either. It is about error recovery and functional programming.
</p></blockquote>
<p>On of the comments on Damien&#8217;s page makes a point to that effect;</p>
<blockquote><p>
[&#8230;] the title is misleading. The answer to &#8220;error codes&#8221; or &#8220;exceptions&#8221; is (correctly) &#8220;depends on the situation&#8221; &#8230; but discussion on this is only a fraction of the article.
</p></blockquote>]]></content:encoded>
	</item>
	<item>
		<title>By: Fenrir2</title>
		<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/#comment-21304</link>
		<dc:creator>Fenrir2</dc:creator>
		<pubDate>Sun, 30 Apr 2006 08:56:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1521#comment-21304</guid>
		<description>I'm sorry to say, but I think you missed the point of the article. It isn't about php, and not about web programming either. It is about error recovery and functional programming.

He does point out cases where exceptions are more expressive (sure, error codes could be used too). And he mentions a few other methods.

You should read this article in a web programming context. It really is about general error recovery. He just compares the shared nothing architecture of PHP with functional programming, where every function is essentially shares nothing with other functions.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry to say, but I think you missed the point of the article. It isn&#8217;t about php, and not about web programming either. It is about error recovery and functional programming.</p>
<p>He does point out cases where exceptions are more expressive (sure, error codes could be used too). And he mentions a few other methods.</p>
<p>You should read this article in a web programming context. It really is about general error recovery. He just compares the shared nothing architecture of PHP with functional programming, where every function is essentially shares nothing with other functions.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Marston</title>
		<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/#comment-21301</link>
		<dc:creator>Tony Marston</dc:creator>
		<pubDate>Sun, 30 Apr 2006 08:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1521#comment-21301</guid>
		<description>I think people who say that PHP's lack of exceptions makes it impossible/difficult to deal with errors are, quite frankly, talking out of the wrong end of their alimentary canals.

In software there are only two types of errors - recoverable and irrecoverable. It it is recoverable you display an error message to the user and ask him to choose what to do next. You do not need exceptions to achieve this.

If it is irrecoverable then you don't waste time asking the user what to do next as there is no choice. You produce a dump or stack trace or whatever and abort. Again you don't need exceptions for this as PHP's good old fashioned error handler does the trick admirably.

People who can't program without exceptions just aren't good programmers. Period.</description>
		<content:encoded><![CDATA[<p>I think people who say that PHP&#8217;s lack of exceptions makes it impossible/difficult to deal with errors are, quite frankly, talking out of the wrong end of their alimentary canals.</p>
<p>In software there are only two types of errors - recoverable and irrecoverable. It it is recoverable you display an error message to the user and ask him to choose what to do next. You do not need exceptions to achieve this.</p>
<p>If it is irrecoverable then you don&#8217;t waste time asking the user what to do next as there is no choice. You produce a dump or stack trace or whatever and abort. Again you don&#8217;t need exceptions for this as PHP&#8217;s good old fashioned error handler does the trick admirably.</p>
<p>People who can&#8217;t program without exceptions just aren&#8217;t good programmers. Period.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Benjymouse</title>
		<link>http://www.sitepoint.com/blogs/2006/04/30/php-to-the-rescue/#comment-21298</link>
		<dc:creator>Benjymouse</dc:creator>
		<pubDate>Sun, 30 Apr 2006 07:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1521#comment-21298</guid>
		<description>I don't get this. Is this implying that PHP is more mature in this matter than other web technologies. Because - quite frankly - that's untrue. JSPs execute with no shared state. JSF, ASP.NET executes with no shared state. Tapestry executes with no shared state.

For all of the above web techs, once a page is rendered it's state is gone. *Unless* the programmer explicitly chooses to store state in a "session". And that's true for PHP $_SESSION as well.

If anything, of all of the above, PHP has arguably the weakest exception handling.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t get this. Is this implying that PHP is more mature in this matter than other web technologies. Because - quite frankly - that&#8217;s untrue. JSPs execute with no shared state. JSF, ASP.NET executes with no shared state. Tapestry executes with no shared state.</p>
<p>For all of the above web techs, once a page is rendered it&#8217;s state is gone. *Unless* the programmer explicitly chooses to store state in a &#8220;session&#8221;. And that&#8217;s true for PHP $_SESSION as well.</p>
<p>If anything, of all of the above, PHP has arguably the weakest exception handling.</p>]]></content:encoded>
	</item>
</channel>
</rss>
