<?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>Professional PHP &#187; rubyonrails</title>
	<atom:link href="http://www.procata.com/blog/archives/tag/rubyonrails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.procata.com/blog</link>
	<description>PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.</description>
	<lastBuildDate>Fri, 10 Dec 2010 17:23:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Comparing PHP with other languages</title>
		<link>http://www.procata.com/blog/archives/2006/02/09/comparing-php-with-other-languages/</link>
		<comments>http://www.procata.com/blog/archives/2006/02/09/comparing-php-with-other-languages/#comments</comments>
		<pubDate>Fri, 10 Feb 2006 02:51:10 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[dynamic-typing]]></category>
		<category><![CDATA[garbage-collection]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[memory-management]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming-language]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[static-typing]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=174</guid>
		<description><![CDATA[Chris Shiflett posted some thoughts on PHP and Ruby on Rails which has generated some interesting discussion.  Chris divides programming languages into two categories:

Flexible and powerful: PHP, C, C++, and Perl.
Structured and organized: Java, Ruby, and ASP.NET.

I don&#8217;t disagree with the cultural grouping.  PHP&#8217;s cultural heritage is definitely in the Unix programming, C/Perl [...]]]></description>
			<content:encoded><![CDATA[<p>Chris Shiflett posted some thoughts on <a href="http://shiflett.org/archive/190">PHP and Ruby on Rails</a> which has generated some interesting discussion.  Chris divides programming languages into two categories:</p>
<ul>
<li>Flexible and powerful: PHP, C, C++, and Perl.</li>
<li>Structured and organized: Java, Ruby, and ASP.NET.</li>
</ul>
<p>I don&#8217;t disagree with the cultural grouping.  PHP&#8217;s cultural heritage is definitely in the Unix programming, C/Perl camp as I suggested in <a href="http://www.procata.com/blog/archives/2006/01/13/building-a-culture-of-objects-in-php/">building a culture of objects in PHP</a> and <a href="http://www.procata.com/blog/archives/2005/09/29/why-isnt-php-the-natural-successor-to-java/">Why isn&#8217;t PHP the natural successor to Java?</a></p>
<p>I prefer to group languages in  a different way.</p>
<h4>Garbage Collection</h4>
<p>To me, this is the single biggest language comparison issue.  Managing memory is orthogonal to the task most programmers are trying to accomplish.  Thats a fancy way of saying a waste of time.  Additionally, memory management is easy to screw up.  Any process that relies on humans repeatedly doing something correctly is destined for disappointment.  Sure, there are tools that help avoid memory management bugs.  The best of these is to take it off the programmers plate entirely with garbage collection and let the programmer concentrate on other things.</p>
<p>Sure, there can be resource usage and performance issues.  However, for most cases computer hardware is cheaper than computer programmers.</p>
<p>We can divide our languages along this axis:</p>
<ul>
<li>Quickly runs: PHP, Java, Ruby, C#, Perl, Python, Smalltalk</li>
<li>Runs quickly: C, C++, Objective C, Delphi</li>
</ul>
<p>Interestingly, this corresponds fairly closely with native executable versus virtual machine.</p>
<h4>Static or Dynamic Typing</h4>
<p>The next most important axis of comparison is dynamic or static typing.  In static typing type information is associated with the variable.  In dynamic typing type information is associated with the value in the variable.</p>
<p>The benefit of dynamic typing is that you do not waste programmer time and attention with typecasting (&#8221;static types get in my way&#8221;).  The benefit of static typing is that the compiler can catch certain errors (&#8221;The compiler finds my mistakes&#8221;).</p>
<ul>
<li>Risk tolerant: PHP, Ruby, Python, Smalltalk, Perl</li>
<li>Risk averse: Java, C#</li>
</ul>
<h4>Interactive or Batch</h4>
<p>Some might call this axis interpreted versus compiled.  The issue is how long does it take to switch contexts from coding to running?  Is there a lengthy build process or a deployment stage?  The shorter the build process, the more productive development can be.</p>
<ul>
<li>Interactive: PHP, Ruby</li>
<li>Batch: Java</li>
</ul>
<p>A good example of this in the PHP world is to look at Smarty and Propel.  They both generate code to execute.  Smarty does it interactively, while Propel requires a build process.  The build process is the primary reason I don&#8217;t use Propel.</p>
<h4>Scope</h4>
<p>One should not underestimate the importance of this factor.  Why is Java considered so complicated?  One reason is that it is designed to run on everything from servers to cell phones, from desktops to dishwashers.  It&#8217;s scope is impossibly general.  Of course, specialized tools such as Rails and PHP are more productive for their sweet spot applications.</p>
<ul>
<li>General: Java, .NET</li>
<li>Specific: PHP, Rails</li>
</ul>
<h4>PHP and Ruby on Rails are two peas in a pod</h4>
<p>Looking at these factors so far, PHP and Ruby on Rails are two peas in a pod. Lets start looking at some of the factors where Ruby and PHP begin to diverge.</p>
<h4>Popularity</h4>
<p>Popularity brings better tools, more available developers, better documentation, and better productivity.  Programming on a discontinued or rarely used platform is more difficult.</p>
<ul>
<li>Popular: PHP, .NET, Java</li>
<li>Rare: Python, Ruby, Smalltalk</li>
</ul>
<h4>Abstraction</h4>
<p>Working at a higher level of abstraction allows the programmer to be more productive.  The computer industry has continuously been heading up the abstraction scale without looking back.  Professional programmers want to work with higher level constructs because they are more expressive.  One can get more done with less code.  The draw back is that higher level language features can require more programmer skill to use well.  </p>
<ul>
<li>Simple: PHP, C, Java</li>
<li>Powerful: Ruby, Smalltalk, Lisp</li>
</ul>
<p>I&#8217;m talking about the language, not the libraries when I classify Java as simple.  Dynamic versus static typing aside, I see the Java and PHP languages as similarly expressive.</p>
<p>I have alot of respect for <a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg">Anders Hejlsberg</a> and there is some serious innovation going on in the C# world on this front.  Java can barely keep up.</p>
<p>The Rails folks are fond of saying that Rails couldn&#8217;t be written without the expressive features of the Ruby language.  It would be interesting to get the opinions of some of the cake developers on this idea.</p>
<h4>Library Organization</h4>
<p>Not my favorite part of PHP.</p>
<ul>
<li>Function oriented: C, PHP</li>
<li>Object oriented: Java, .Net, Python, Ruby</li>
</ul>
<h4>Stiffies?</h4>
<p>I think Ruby is misclassified when placed with Java and C#.  Ruby is closer to PHP than it is to either Java or C#.  Rails and PHP share most of the same sources of productivity: garbage collection, dynamic typing, interactivity, and focus on web applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2006/02/09/comparing-php-with-other-languages/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Why isn&#8217;t PHP the natural successor to Java?</title>
		<link>http://www.procata.com/blog/archives/2005/09/29/why-isnt-php-the-natural-successor-to-java/</link>
		<comments>http://www.procata.com/blog/archives/2005/09/29/why-isnt-php-the-natural-successor-to-java/#comments</comments>
		<pubDate>Thu, 29 Sep 2005 17:42:19 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Agile Methods]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[object-oriented-programming]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[php-frameworks]]></category>
		<category><![CDATA[programming-language]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubyonrails]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=140</guid>
		<description><![CDATA[Loud thinking declares that Java has lost its aura of invincibility.  Jason Hunter sums it up nicely:
Ruby on Rails today looks poised to eat Java&#8217;s mindshare on the web tier. If not Rails, then something else.
It does seem like Java&#8217;s mindshare is on the decline, along with sun&#8217;s fortunes. There is some evidence that [...]]]></description>
			<content:encoded><![CDATA[<p>Loud thinking <a href="http://www.loudthinking.com/arc/000517.html">declares</a> that Java has lost its aura of invincibility.  Jason Hunter <a href="http://www.servlets.com/blog/archives/000068.html">sums it up</a> nicely:</p>
<blockquote><p>Ruby on Rails today looks poised to eat Java&#8217;s mindshare on the web tier. If not Rails, then something else.</p></blockquote>
<p>It does seem like Java&#8217;s mindshare is on the <a href="http://gnuvince.net/?p=62">decline</a>, along with sun&#8217;s fortunes. There is <a href="http://www.surveymonkey.com/DisplaySummary.asp?SID=1360166&#038;U=136016677100">some evidence</a> that rails is drawing mindshare from PHP as well.  (Mind share is the grown-up way of saying &#8220;what the cool kids are doing.&#8221;)</p>
<p>So why isn&#8217;t PHP that something else?</p>
<p>i think its the unit testing, &#8220;You aren&#8217;t gonna need it,&#8221; &#8220;Do the simplest thing that could possibly work&#8221; folk that are dismantling Java&#8217;s mindshare.  As they gain it, Java loses it.  Some of that is showing up in the java community itself in concepts like POJOs and dependency injection.  Some of it shows up in an exodus from Java to dynamic languages.</p>
<p>So why are the agile leaders like <a href="http://www.martinfowler.com/bliki/RubyPeople.html">Martin Fowler</a> and <a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi">Dave Thomas</a> working with Ruby instead of PHP?  David Heinemeier Hansson <a href="">directly credits</a> these guys with influencing his decision to stop programming rails in PHP and move to ruby.  I suspect that its the dynamic, smalltalk, like features of Ruby that appeal the the agile methods leaders.</p>
<p>Rails could have been a PHP framework, but wasn&#8217;t.  Although, I&#8217;m not sure that it would get the attention it is if it were a PHP framework.  The rails, ruby combination may be greater than the sum of the parts.</p>
<p>I can&#8217;t speak for anyone else, but I have some ideas about why PHP might not appeal to the agile method and java is too complicated folk:</p>
<ul>
<li>Too many globals &#8211; globals make unit testing more difficult and prevent integrating work from different developers, let alone different organizations.</li>
<li>No culture of objects &#8211; PHP has made great strides in this area, but I don&#8217;t get the impression that many of the folk that work on and with PHP really buy into object oriented programming the way that the agile methods folk do.</li>
<li>Crowded namespaces &#8211; How many functions is PHP up to?  Constants?</li>
<li>incomplete component model &#8211; This is another integration thing.  PHP has too many islands and not enough continents.  (I&#8217;m talking beans here, but definitely not EJB.)</li>
<li>No mature frameworks &#8211; Ruby has been around a long time, but didn&#8217;t really start gulping mindshare until Rails came along.  See <a href="http://www.procata.com/blog/archives/2004/11/28/the-value-of-mvc/">The Value of MVC</a>.</li>
<li>No closures &#8211; Its a dynamic thing.</li>
<li>Expert level gotchas &#8211; hopping on the learning curve is easy.  Reaching the top, not so much.</li>
</ul>
<p>I&#8217;ll elaborate on each of these points in a series of upcoming posts.</p>
<p>I&#8217;ll close by saying that life is not a zero sum game.  The success of Ruby and Rails does not diminish the success of PHP.  The cool kids were doing Java and now some of them are doing Ruby.  Oh, well.  Its disappointing that more of them aren&#8217;t doing PHP, but PHP has many things going for it.  That, however, is a different series of posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2005/09/29/why-isnt-php-the-natural-successor-to-java/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

