<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Paul Goscicki &#187; php</title>
	<atom:link href="http://paulgoscicki.com/categories/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://paulgoscicki.com</link>
	<description>Random pieces of code, thoughts and movie reviews</description>
	<lastBuildDate>Tue, 15 Nov 2011 18:45:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Why I hate PHP</title>
		<link>http://paulgoscicki.com/archives/2006/12/why-i-hate-php/</link>
		<comments>http://paulgoscicki.com/archives/2006/12/why-i-hate-php/#comments</comments>
		<pubDate>Mon, 25 Dec 2006 19:27:53 +0000</pubDate>
		<dc:creator>Paul Goscicki</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://paulgoscicki.com/archives/2006/12/why-i-hate-php/</guid>
		<description><![CDATA[echo (0 == null); =&#62; 1 @#$%@*@*%@#! To those unfamiliar with PHP, 1 stands for true in PHP. Apparently, I&#8217;m not alone in my hatred.]]></description>
			<content:encoded><![CDATA[<pre class="code">
echo (0 == null);
=&gt; 1
</pre>
<p>@#$%@*@*%@#!</p>
<p>To those unfamiliar with PHP, <code>1</code> stands for <code>true</code> in PHP. Apparently, <a href="http://www.anti-php.net/">I&#8217;m not alone</a> in my hatred.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulgoscicki.com/archives/2006/12/why-i-hate-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Yet another anti-PHP rant</title>
		<link>http://paulgoscicki.com/archives/2006/02/yet-another-anti-php-rant/</link>
		<comments>http://paulgoscicki.com/archives/2006/02/yet-another-anti-php-rant/#comments</comments>
		<pubDate>Sun, 26 Feb 2006 14:19:36 +0000</pubDate>
		<dc:creator>Paul Goscicki</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://paulgoscicki.com/?p=55</guid>
		<description><![CDATA[I’m quite surprised to see this great stir in the blogosphere caused by Tim Bray and his essay On PHP. I mean, what’s the deal anyway? We all know that PHP is a lousy programming language. So instead on focusing on the big picture and trying to list as many of its faults as I [...]]]></description>
			<content:encoded><![CDATA[<p>I’m quite surprised to see this great stir in the blogosphere caused by <a href="http://www.tbray.org/ongoing/">Tim Bray</a> and his essay <a href="http://www.tbray.org/ongoing/When/200x/2006/02/17/PHP">On PHP</a>. I mean, what’s the deal anyway? <a href="http://www.beastwithin.org/users/wwwwolf/code/phprant.html">We</a> <a href="http://maurus.net/work/php-sucks/">all</a> <a href="http://plasmasturm.org/log/393/">know</a> that <a href="http://php.net/">PHP</a> is a lousy programming language. So instead on focusing on the big picture and trying to list as many of its faults as I can remember, I’ll stay on one specific problem, which is really a pain for me.</p>
<p>I’ve been programming in PHP for the past five years (I’ve started using it in the beginning of 2001, during my Computer Science studies). PHP is (was?) both my love and hate. My biggest complain about it, and probably about all other programming languages used for web development, is that there is no decent way of producing HTML code from your application. No matter how hard you try, you’ll always end up having spaghetti either in your HTML or in PHP code (or even worse, in both places). Sure, separating business from presentation logic is a common practice which helps the cause (apart from the fact that most PHP folks mix HTML with PHP whenever and wherever they can). Problem is, that it’s not good enough.</p>
<p>It would be all much simpler if you didn’t need to put any logic into your presentation code. The moment you introduce loops or conditionals – bam – you either get unreadable code or spaghetti HTML with way too much whitespace (or without any whitespace at all) and improper indentation. Not to mention that I am probably not the only one sick of typing all those nasty angle brackets all the time. But what about all that specialized templating engines? Frankly, they are not any better. Besides the fact that some of them require a certain overhead (like defining the variables you wish to use in your templates – <a href="http://smarty.php.net/">Smarty</a>, anyone?), they all still carry the same burden – they either produce spaghetti HTML or have spaghetti templates.</p>
<p>Actually, <a href="http://rubyonrails.org/">Rails</a>, being my current weapon of choice, is no better in this area. My .rhtml templates are a complete mess. I strive to have my HTML as pretty as it can be, because (maybe strangely) I find it easier to debug if I have a nice HTML output to deal with, instead of a nice .rhtml template. Too bad that I feel <em>utter disgust</em> when I look at those templates. And just as Smarty is no better for PHP, <a href="http://home.leetsoft.com/liquid">Liquid</a> and similar projects are no better for Rails. However, there is still hope, with projects like <a href="http://redhanded.hobix.com/inspect/markabyForRails.html">Markaby</a> (which, unfortunately, has its own issues, check the <a href="http://redhanded.hobix.com/inspect/markabyForRails.html#comments">comments</a>).</p>
<p>Just a small digression, to sum all this up. Rails has solved one other, big inconvenience, namely writing your own SQL for each and every interaction with the database. Thanks to <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> provided by <a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html">ActiveRecord</a>, you don’t have to write SQL any more (at least in most of the cases; the <a href="http://en.wikipedia.org/wiki/Pareto_principle">80/20 rule</a>). This is one of the basic reasons that Rails is so much better than PHP. Markaby tries to do the same to HTML, what ActiveRecord did to SQL. No more those nasty <strong>&lt; /&gt;</strong> characters! We’ll see how (and where) it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulgoscicki.com/archives/2006/02/yet-another-anti-php-rant/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

