<?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; ruby</title>
	<atom:link href="http://www.procata.com/blog/archives/tag/ruby/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>Tue, 20 Oct 2009 00:57:46 +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>Keywords and Language Simplicity</title>
		<link>http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/</link>
		<comments>http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 18:38:26 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[programming-language]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/</guid>
		<description><![CDATA[Well, I like programming language comparisons, so how could I resist this chart (via) promoting the simplicity of the io language by pointing out how few keywords it has.  The interesting thing about this is that Java and PHP are tied on this measure of simplicity with 53 keywords.  Perhaps that reflects Java&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I like programming language comparisons, so how could I resist <a href="http://iolanguage.com/about/simplicity/">this chart</a> (<a href="http://programming.reddit.com/info/2z11k/comments">via</a>) promoting the simplicity of the io language by pointing out how few keywords it has.  The interesting thing about this is that Java and PHP are tied on this measure of simplicity with 53 keywords.  Perhaps that reflects Java&#8217;s heritage as a simplification of C++ (63 keywords) and PHP&#8217;s heritage as an amplification of C (37 keywords) toward a specific purpose?  As usual, Perl is the poster child for language complexity.  Ruby does well with 40 keywords. But, before the Ruby fans get too uppity about the simplicity of their language, they should contemplate the <a href="http://www.zenspider.com/Languages/Ruby/QuickRef.html#18">cat walked across the keyboard while I was holding down the shift key</a> predefined variables that they inherited from Perl.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2007/10/11/keywords-and-language-simplicity/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>James Gosling on PHP</title>
		<link>http://www.procata.com/blog/archives/2006/03/11/james-gosling-on-php/</link>
		<comments>http://www.procata.com/blog/archives/2006/03/11/james-gosling-on-php/#comments</comments>
		<pubDate>Sat, 11 Mar 2006 16:07:50 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[james-gosling]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scripting-languages]]></category>
		<category><![CDATA[simplicity]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=176</guid>
		<description><![CDATA[James Gosling, the &#8220;father of Java,&#8221; recently commented on PHP:

&#8220;PHP and Ruby are perfectly fine systems,&#8221; he continued, &#8220;but they are scripting languages and get their power through specialization: they just generate web pages. But none of them attempt any serious breadth in the application domain and they both have really serious scaling and performance [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/James_Gosling">James Gosling</a>, the &#8220;father of Java,&#8221; recently <a href="http://java.sys-con.com/read/193146.htm">commented on PHP</a>:</p>
<blockquote><p>
&#8220;PHP and Ruby are perfectly fine systems,&#8221; he continued, &#8220;but they are scripting languages and get their power through specialization: they just generate web pages. But none of them attempt any serious breadth in the application domain and they both have really serious scaling and performance problems.&#8221;<br />
&#8230;<br />
PHP (for example) is able to make things simpler because it&#8217;s 100% aimed at web pages, Gosling explained. Whereas with Java, he said, &#8220;We have a balancing act: we need the simplicity but we also need power.&#8221;</p></blockquote>
<p>The headline here should be &#8220;Father of Java says writing web applications in PHP is simpler.&#8221;  This is pretty much what I said in my <a href="http://www.procata.com/blog/archives/2006/02/09/comparing-php-with-other-languages/">Comparing PHP with other languages</a> post:</p>
<blockquote><p>
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></blockquote>
<p>Both .NET and Java have this be all things to everyone mentality.  If you need that generalization, fine, but generalization is not without cost as Gosling points out.</p>
<blockquote><p>
He called Simplicity and Power &#8220;evil twin brothers&#8221; &#8211; &#8220;Building systems that have a lot of power just attract complexity. Because of the way that the world has become so interconnected it helps to have systems where it carries over from one domain to another. You can do web presnentation stuff really well in PHP but you couldn&#8217;t write a library that does, say, interplanetary navigation.
</p></blockquote>
<p>So, if you are writing software for interplanetary navigations, by all means, choose Java. If you  just want to write really good web applications quickly, choose PHP.</p>
<p>Regarding the scalability and performance characterization.  I&#8217;m so tired of that.  PHP performs and scales just fine for many people. Flickr makes an interesting case study of PHP scaling:</p>
<ul>
<li><a href="http://www.25hoursaday.com/weblog/PermaLink.aspx?guid=2e03a43a-535e-49a1-afaa-b47eab5f71c2">Scaling fast and cheap &#8211; how we built flickr</a></li>
<li><a href="http://blog.flickr.com/flickrblog/2005/10/lamp.html">Hardware Layouts for LAMP Installations</a></li>
<li><a href="http://software.newsforge.com/print.pl?sid=05/01/27/170244">Open source helps Flickr share photos</a></li>
<li><a href="http://www.procata.com/blog/archives/2004/10/27/flickr-case-study/">flickr and PHP</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2006/03/11/james-gosling-on-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>29</slash:comments>
		</item>
		<item>
		<title>PHP Book sales trends versus Java and Ruby</title>
		<link>http://www.procata.com/blog/archives/2005/12/08/php-book-sales-trends-versus-java-and-ruby/</link>
		<comments>http://www.procata.com/blog/archives/2005/12/08/php-book-sales-trends-versus-java-and-ruby/#comments</comments>
		<pubDate>Thu, 08 Dec 2005 19:06:16 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[programming-language]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=167</guid>
		<description><![CDATA[O&#8217;Reilly radar has an interesting graph of 2004 versus 2005 book sales for a variety of languages.  The big news is that Ruby books sales are up 1552% and Java book sales are down 4%.  This would be consistent with my observations from Why isnâ€™t PHP the natural successor to Java.  A [...]]]></description>
			<content:encoded><![CDATA[<p>O&#8217;Reilly radar has an interesting graph of <a href="http://radar.oreilly.com/archives/2005/12/ruby_book_sales_surpass_python.html">2004 versus 2005</a> book sales for a variety of languages.  The big news is that Ruby books sales are up 1552% and Java book sales are down 4%.  This would be consistent with my observations from <a href="http://www.procata.com/blog/archives/2005/09/29/why-isnt-php-the-natural-successor-to-java/">Why isnâ€™t PHP the natural successor to Java</a>.  A small cadre of agile minded developers are giving Ruby a spin.</p>
<p>Meanwhile, there is no change in PHP book sales.  Perhaps this suggests that Java is loosing to Ruby, but PHP is not?  Or PHP is gaining from Perl, the other language with declining sales, just as fast as its loosing to Ruby?  Perhaps you can&#8217;t read anything much at all into these numbers.</p>
<p>Also mentioned is that Java books outsell PHP books by 2.5x and PHP books outsell Ruby books by 3x.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2005/12/08/php-book-sales-trends-versus-java-and-ruby/feed/</wfw:commentRss>
		<slash:comments>4</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>16</slash:comments>
		</item>
	</channel>
</rss>
