<?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: A Python replacement for PHP software ?</title>
	<atom:link href="http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/</link>
	<description>Eli Bendersky's personal website</description>
	<lastBuildDate>Wed, 10 Mar 2010 17:32:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: thibauld</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-143829</link>
		<dc:creator>thibauld</dc:creator>
		<pubDate>Sat, 06 Dec 2008 14:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-143829</guid>
		<description>Hi,

I agree with you that PHP is far from being the most beautiful language out there. Python and Ruby are better designed languages but the fact is that Python or Ruby&#039;s learning curve is a lot steeper. PHP could be compared to VB for the Web: easy to learn with great documentation all over the place and works.

Let&#039;s take an example here. Let&#039;s compare how you remove duplicates from an array in PHP and a sequence in Python :
PHP is easy : 
`&lt;code&gt;$array = array_unique($array);&lt;/code&gt;`
For Python however, you need a MS in computer science :
`&lt;code&gt;seq = list(set(seq))&lt;/code&gt;`

Granted, this example does not work for Ruby (as easy as `&lt;code&gt;array = array__abENT__#46;uniq&lt;/code&gt;` ) but it was just to illustrate that beautiful languages are not necessarily the easiest to use. Plus the fact that PHP is completely web oriented and a rock solid language and you understand its success. Plus, you can write beautiful code with PHP too... it just requires good coders.

I wrote a post about choosing the right software stack a while ago, you&#039;ll find it here : &lt;a href=&quot;http://thibauld.com/2008/11/web-application-implementation-step-1-choose-your-weapons/&quot; rel=&quot;nofollow&quot;&gt;Web application implementation step 1: Choose your weapons!&lt;/a&gt;
Cheers,</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I agree with you that PHP is far from being the most beautiful language out there. Python and Ruby are better designed languages but the fact is that Python or Ruby&#8217;s learning curve is a lot steeper. PHP could be compared to VB for the Web: easy to learn with great documentation all over the place and works.</p>
<p>Let&#8217;s take an example here. Let&#8217;s compare how you remove duplicates from an array in PHP and a sequence in Python :<br />
PHP is easy :<br />
<code class="backtick">$array = array_unique($array);</code><br />
For Python however, you need a MS in computer science :<br />
<code class="backtick">seq = list(set(seq))</code></p>
<p>Granted, this example does not work for Ruby (as easy as <code class="backtick">array = array&#46;uniq</code> ) but it was just to illustrate that beautiful languages are not necessarily the easiest to use. Plus the fact that PHP is completely web oriented and a rock solid language and you understand its success. Plus, you can write beautiful code with PHP too&#8230; it just requires good coders.</p>
<p>I wrote a post about choosing the right software stack a while ago, you&#8217;ll find it here : <a href="http://thibauld.com/2008/11/web-application-implementation-step-1-choose-your-weapons/" rel="nofollow">Web application implementation step 1: Choose your weapons!</a><br />
Cheers,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arun</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142855</link>
		<dc:creator>Arun</dc:creator>
		<pubDate>Tue, 02 Dec 2008 14:13:55 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142855</guid>
		<description>PHP and Python uses different models of web development. PHP uses the simple CGI model where each file is a mix of executable code and presentation logic. Easy to deploy, horrible to maintain and a nightmare for security.

Python frameworks like Django/Pylons use a more evolved model. The logic is separated from presentation as much as possible. There is a tremendous flexibility in creating URLs and possibly RESTful web interfaces. The downside of this being some overhead in setting up the website.

I am not sure if this can be simplified to the level of PHP. Some alternatives like using easy_install exists, but they are a far cry from the simplicity of the &quot;drop the php files into a directory and point your browser&quot;.</description>
		<content:encoded><![CDATA[<p>PHP and Python uses different models of web development. PHP uses the simple CGI model where each file is a mix of executable code and presentation logic. Easy to deploy, horrible to maintain and a nightmare for security.</p>
<p>Python frameworks like Django/Pylons use a more evolved model. The logic is separated from presentation as much as possible. There is a tremendous flexibility in creating URLs and possibly RESTful web interfaces. The downside of this being some overhead in setting up the website.</p>
<p>I am not sure if this can be simplified to the level of PHP. Some alternatives like using easy_install exists, but they are a far cry from the simplicity of the &#8220;drop the php files into a directory and point your browser&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cord</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142462</link>
		<dc:creator>cord</dc:creator>
		<pubDate>Sun, 30 Nov 2008 21:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142462</guid>
		<description>I agree with Carlo and Brian (above).

I&#039;m not sure, but I suspect that both Python (mod_python) and Perl (mod_perl) suffer from the same affliction here. My novice&#039;s understanding is that mod_{python,perl} provide access to Apache internals, while mod_php simply lets you run your php code in a persistent instance of the php interpreter. So, it makes it safe and easy for admins to provide mod_php, but not mod_{perl,python}.

In defense of Perl and Python, I think the argument usually goes something like, &quot;But with mod_{pl,py} you have much more power and control!&quot;. Unfortunately, I don&#039;t believe that&#039;s what&#039;s needed for mass adoption and ease of use: what&#039;s needed is just for Apache to provide that nice sandbox that simply lets web devs have a persistent {Perl,Python} interpreter running.

No idea why this hasn&#039;t been done yet. Seems like a no-brainer, but maybe I&#039;m missing something.</description>
		<content:encoded><![CDATA[<p>I agree with Carlo and Brian (above).</p>
<p>I&#8217;m not sure, but I suspect that both Python (mod_python) and Perl (mod_perl) suffer from the same affliction here. My novice&#8217;s understanding is that mod_{python,perl} provide access to Apache internals, while mod_php simply lets you run your php code in a persistent instance of the php interpreter. So, it makes it safe and easy for admins to provide mod_php, but not mod_{perl,python}.</p>
<p>In defense of Perl and Python, I think the argument usually goes something like, &#8220;But with mod_{pl,py} you have much more power and control!&#8221;. Unfortunately, I don&#8217;t believe that&#8217;s what&#8217;s needed for mass adoption and ease of use: what&#8217;s needed is just for Apache to provide that nice sandbox that simply lets web devs have a persistent {Perl,Python} interpreter running.</p>
<p>No idea why this hasn&#8217;t been done yet. Seems like a no-brainer, but maybe I&#8217;m missing something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr. Green</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142434</link>
		<dc:creator>Dr. Green</dc:creator>
		<pubDate>Sun, 30 Nov 2008 18:57:54 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142434</guid>
		<description>Hi there. Nice post. You should not so strongly tie PHP with WordPress. I have been coding in PHP professionally for several years and WordPress has got to be some of the worst code I have ever seen. Its had a long history of terrible security issues too. You do get some good PHP code, it just depends on who is writing it. To give you an idea, the lead architect of WordPress codes in Dreamweaver on Windows. Whereas good PHP programmers are on &#039;nux and probably using an editor like jEdit. I even know a guy who codes all his sites in Vim.

However. I 100% agree with you that Python is a superior language, despite the fact I continue to program in PHP. earlier this year I grew disillusioned with PHP and looked into other languages and came to the conclusion that Python was the best. Mainly due to everything being an object and multiple inheritance.

The problem is, its like M$ vs. Linux and there is strength in numbers. Hopefully something will turn the tide though, like a replacement for WordPress in Python.</description>
		<content:encoded><![CDATA[<p>Hi there. Nice post. You should not so strongly tie PHP with WordPress. I have been coding in PHP professionally for several years and WordPress has got to be some of the worst code I have ever seen. Its had a long history of terrible security issues too. You do get some good PHP code, it just depends on who is writing it. To give you an idea, the lead architect of WordPress codes in Dreamweaver on Windows. Whereas good PHP programmers are on &#8216;nux and probably using an editor like jEdit. I even know a guy who codes all his sites in Vim.</p>
<p>However. I 100% agree with you that Python is a superior language, despite the fact I continue to program in PHP. earlier this year I grew disillusioned with PHP and looked into other languages and came to the conclusion that Python was the best. Mainly due to everything being an object and multiple inheritance.</p>
<p>The problem is, its like M$ vs. Linux and there is strength in numbers. Hopefully something will turn the tide though, like a replacement for WordPress in Python.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Lellelid</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142378</link>
		<dc:creator>Hans Lellelid</dc:creator>
		<pubDate>Sun, 30 Nov 2008 14:02:31 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142378</guid>
		<description>@Dmitry:

I agree that there are also some very bad programmers who will write bad code in any language, but I disagree strongly with the suggestion that there is nothing wrong with PHP.  I can give you a long list of things that are wrong with it, but I&#039;ll mention just a few:  no unified error system, no consistency in the core APIs, poor unicode support, no safe way to run in multi-threaded environment, and half-baked OO support (e.g. strict signatures, but no ability to overload), no namespaces or packages (may finally change with 5.3, but too little too late IMO). 

Hans</description>
		<content:encoded><![CDATA[<p>@Dmitry:</p>
<p>I agree that there are also some very bad programmers who will write bad code in any language, but I disagree strongly with the suggestion that there is nothing wrong with PHP.  I can give you a long list of things that are wrong with it, but I&#8217;ll mention just a few:  no unified error system, no consistency in the core APIs, poor unicode support, no safe way to run in multi-threaded environment, and half-baked OO support (e.g. strict signatures, but no ability to overload), no namespaces or packages (may finally change with 5.3, but too little too late IMO). </p>
<p>Hans</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry Chestnykh</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142153</link>
		<dc:creator>Dmitry Chestnykh</dc:creator>
		<pubDate>Sat, 29 Nov 2008 08:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142153</guid>
		<description>I too tweaked a few plugins for WordPress, and wrote a few myself, I prefer Python (and write desktop and web applications in it), but there&#039;s nothing wrong with PHP — the problem is the programmer. I don&#039;t think that those programmers who write *bad* PHP code will magically write better Python code.

As for OOP, I want to point out the following article on Drupal OOP implementation:
http://api.drupal.org/api/file/developer/topics/oop.html

There&#039;s nothing wrong with not using OOP, or not using OOP functions build into the language.</description>
		<content:encoded><![CDATA[<p>I too tweaked a few plugins for WordPress, and wrote a few myself, I prefer Python (and write desktop and web applications in it), but there&#8217;s nothing wrong with PHP — the problem is the programmer. I don&#8217;t think that those programmers who write *bad* PHP code will magically write better Python code.</p>
<p>As for OOP, I want to point out the following article on Drupal OOP implementation:<br />
<a href="http://api.drupal.org/api/file/developer/topics/oop.html" rel="nofollow">http://api.drupal.org/api/file/developer/topics/oop.html</a></p>
<p>There&#8217;s nothing wrong with not using OOP, or not using OOP functions build into the language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sapphirecat</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142087</link>
		<dc:creator>sapphirecat</dc:creator>
		<pubDate>Sat, 29 Nov 2008 00:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142087</guid>
		<description>Agreed on the ease of PHP hosting. With no caches or moving parts, it trades power for ease of coding and administration. No URL routing, no persistent variables for one script run to affect the next one, no &quot;weird complicated stuff&quot; like MVC, and no way to alter the global Web server configuration. No worrying about spaces vs. tabs, and no headaches from line-ending conventions (something that bit me trying to write Perl in Notepad--we were all young once.) It all adds up.

The worst part about it is that when one platform achieves dominance, it gets inertia too. You have to be much better than the dominant beast in order to win. Otherwise, few people will put up with the pain of the relative lack of apps for the technically better language, and fewer apps will be developed for it, and the cycle continues.</description>
		<content:encoded><![CDATA[<p>Agreed on the ease of PHP hosting. With no caches or moving parts, it trades power for ease of coding and administration. No URL routing, no persistent variables for one script run to affect the next one, no &#8220;weird complicated stuff&#8221; like MVC, and no way to alter the global Web server configuration. No worrying about spaces vs. tabs, and no headaches from line-ending conventions (something that bit me trying to write Perl in Notepad&#8211;we were all young once.) It all adds up.</p>
<p>The worst part about it is that when one platform achieves dominance, it gets inertia too. You have to be much better than the dominant beast in order to win. Otherwise, few people will put up with the pain of the relative lack of apps for the technically better language, and fewer apps will be developed for it, and the cycle continues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Foord</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142072</link>
		<dc:creator>Michael Foord</dc:creator>
		<pubDate>Fri, 28 Nov 2008 23:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142072</guid>
		<description>One possibility is Pinax - which provides reusable Django applications as components that can be plugged together as part of a bigger application.

At work (Resolver Systems) we have a Wordpress blog and a PHP BB forum. We are also in the process of creating a Django based web application. We have already hacked PHP BB to use Django authentication. To have Django applications integrated into the whole system that provided the blog and the forums would be really nice.

Writing a complete blog or forum system is not trivial though. A solution that is 80% for some users is probably only 50% for other users.</description>
		<content:encoded><![CDATA[<p>One possibility is Pinax &#8211; which provides reusable Django applications as components that can be plugged together as part of a bigger application.</p>
<p>At work (Resolver Systems) we have a Wordpress blog and a PHP BB forum. We are also in the process of creating a Django based web application. We have already hacked PHP BB to use Django authentication. To have Django applications integrated into the whole system that provided the blog and the forums would be really nice.</p>
<p>Writing a complete blog or forum system is not trivial though. A solution that is 80% for some users is probably only 50% for other users.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142040</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Fri, 28 Nov 2008 19:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142040</guid>
		<description>I am a ruby user myself since 5 years. I am ok with Python too. I dislike Perl and PHP.

Now with that being stated, I think we must give PHP credit about being to strong in the www area, despite being such a horribly designed language.
And, after we have acknowledged this, all the other languages should be horribly ashamed of themselves for being so incompetent to dethrone PHP seriously.
(For me, ruby as a language has dethroned php years ago already after I wrote an IRC bot in ruby in some days, whereas I had no clue before this task at all how to do it in php. In my case the better language helped ME become better too. It was a huge paradigm shift. Anyway...)

We also need to acknowledge that despite being such a horrible language, there are great PHP apps out there. My personal favourite is still phpBB, despite a few minor flaws. phpBB really is a joy to use and deploy.

I believe to dethrone PHP the most critical aspect will be &quot;key applications&quot;.

For example, trac for python is a killer app for the www. Django as well.

But I dont really know a python-based forum kind that has any serious chance to dethrone phpBB. (Situation with ruby is very similar)

In the long run I believe this situation will change, but for now PHP will still remain number one, despite the recent shrinking (btw the whole computer world as such still grows, so if a language like php shrinks then this means people would be actively moving away from it as a netto result)</description>
		<content:encoded><![CDATA[<p>I am a ruby user myself since 5 years. I am ok with Python too. I dislike Perl and PHP.</p>
<p>Now with that being stated, I think we must give PHP credit about being to strong in the www area, despite being such a horribly designed language.<br />
And, after we have acknowledged this, all the other languages should be horribly ashamed of themselves for being so incompetent to dethrone PHP seriously.<br />
(For me, ruby as a language has dethroned php years ago already after I wrote an IRC bot in ruby in some days, whereas I had no clue before this task at all how to do it in php. In my case the better language helped ME become better too. It was a huge paradigm shift. Anyway&#8230;)</p>
<p>We also need to acknowledge that despite being such a horrible language, there are great PHP apps out there. My personal favourite is still phpBB, despite a few minor flaws. phpBB really is a joy to use and deploy.</p>
<p>I believe to dethrone PHP the most critical aspect will be &#8220;key applications&#8221;.</p>
<p>For example, trac for python is a killer app for the www. Django as well.</p>
<p>But I dont really know a python-based forum kind that has any serious chance to dethrone phpBB. (Situation with ruby is very similar)</p>
<p>In the long run I believe this situation will change, but for now PHP will still remain number one, despite the recent shrinking (btw the whole computer world as such still grows, so if a language like php shrinks then this means people would be actively moving away from it as a netto result)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Lellelid</title>
		<link>http://eli.thegreenplace.net/2008/11/28/a-python-replacement-for-php-software/comment-page-1/#comment-142021</link>
		<dc:creator>Hans Lellelid</dc:creator>
		<pubDate>Fri, 28 Nov 2008 17:47:21 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/?p=1150#comment-142021</guid>
		<description>I&#039;ve been a PHP developer for quite some time, including open-source work (Propel, Creole, Phing); however, I have to say that I completely agree that Python is a fundamentally superior language which really does allow you (and encourage you) to write much better code.  And I would argue that well-architected, maintainable code is a fundamental requirement for a secure application.

A language is just a language, sure.  Just like a car is just a car.  You can get from point A to B in any car, but I&#039;d rather have a car where pieces didn&#039;t start rattling and falling off everytime it gets on the highway.

All my PHP code (for the past 6 years, anyway) has been object-oriented.  I&#039;ve written MVC frameworks, ORM tools, etc.  Sure, you *can* write OO code in PHP and you can use Exceptions, but you are building on top of a language platform that clearly has no concept of OO and will issue unrecoverable fatal errors instead of throwing an Exception.  It&#039;s basically a huge mess and the new namespace stuff is just the comical final chapter in my own interest in PHP as a language.  And don&#039;t even get me started on thread safety, long ints, unicode, date/time values, or database abstraction.

I&#039;ll avoid posting more of a rant in this comment, but here are some links in case anyone cares to know any more about my particular PHP-based perspective on Python:
- http://propel.tigris.org/servlets/ReadMsg?list=dev&amp;msgNo=3480
- http://creole.tigris.org/servlets/ReadMsg?list=users&amp;msgNo=308

Using Python has been a breath of fresh air, and I anticipate that once I become a little more qualified I&#039;ll start doing open-source work in Python too.  I&#039;m particularly intrigued with the Paver project -- and heck, if I can help with something like Zine, that might be lots of fun too.  As evident in the Creole thread, I&#039;m not the only one moving to Python.  I only have anecdotal evidence, but it does seem that there is a growing trend among serious developers in the PHP world to start considering alternative platforms.

-Hans</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been a PHP developer for quite some time, including open-source work (Propel, Creole, Phing); however, I have to say that I completely agree that Python is a fundamentally superior language which really does allow you (and encourage you) to write much better code.  And I would argue that well-architected, maintainable code is a fundamental requirement for a secure application.</p>
<p>A language is just a language, sure.  Just like a car is just a car.  You can get from point A to B in any car, but I&#8217;d rather have a car where pieces didn&#8217;t start rattling and falling off everytime it gets on the highway.</p>
<p>All my PHP code (for the past 6 years, anyway) has been object-oriented.  I&#8217;ve written MVC frameworks, ORM tools, etc.  Sure, you *can* write OO code in PHP and you can use Exceptions, but you are building on top of a language platform that clearly has no concept of OO and will issue unrecoverable fatal errors instead of throwing an Exception.  It&#8217;s basically a huge mess and the new namespace stuff is just the comical final chapter in my own interest in PHP as a language.  And don&#8217;t even get me started on thread safety, long ints, unicode, date/time values, or database abstraction.</p>
<p>I&#8217;ll avoid posting more of a rant in this comment, but here are some links in case anyone cares to know any more about my particular PHP-based perspective on Python:<br />
- <a href="http://propel.tigris.org/servlets/ReadMsg?list=dev&amp;msgNo=3480" rel="nofollow">http://propel.tigris.org/servlets/ReadMsg?list=dev&amp;msgNo=3480</a><br />
- <a href="http://creole.tigris.org/servlets/ReadMsg?list=users&amp;msgNo=308" rel="nofollow">http://creole.tigris.org/servlets/ReadMsg?list=users&amp;msgNo=308</a></p>
<p>Using Python has been a breath of fresh air, and I anticipate that once I become a little more qualified I&#8217;ll start doing open-source work in Python too.  I&#8217;m particularly intrigued with the Paver project &#8212; and heck, if I can help with something like Zine, that might be lots of fun too.  As evident in the Creole thread, I&#8217;m not the only one moving to Python.  I only have anecdotal evidence, but it does seem that there is a growing trend among serious developers in the PHP world to start considering alternative platforms.</p>
<p>-Hans</p>
]]></content:encoded>
	</item>
</channel>
</rss>
