<?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; java</title>
	<atom:link href="http://www.procata.com/blog/archives/tag/java/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>Programming Language Trends via Google</title>
		<link>http://www.procata.com/blog/archives/2006/05/10/programming-language-trends-via-google/</link>
		<comments>http://www.procata.com/blog/archives/2006/05/10/programming-language-trends-via-google/#comments</comments>
		<pubDate>Thu, 11 May 2006 02:47:04 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google-trends]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[programming-language]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/?p=185</guid>
		<description><![CDATA[There is a new google toy as of today: Google Trends.  So of course, I wanted to see how PHP is faring on the trendy landscape.  Here is a comparison of PHP, Java, C#, and Perl:


PHP   Java   C#   Perl

PHP seems to be holding steady, or slightly declining. [...]]]></description>
			<content:encoded><![CDATA[<p>There is a new google toy as of today: <a href="http://google.com/trends">Google Trends</a>.  So of course, I wanted to see how PHP is faring on the trendy landscape.  Here is a comparison of PHP, Java, C#, and Perl:</p>
<p align="center">
<img src="http://google.com/trends/viz?q=php,java,c%23,perl&#038;date=all&#038;geo=all&#038;graph=weekly_img" height="260" width="580" alt="PHP, Java, C# and Perl" align="center" /><br />
<font color="#4684ee">PHP</font>   <font color="#dc3912">Java</font>   <font color="#ff9900">C#</font>   <font color="#008000">Perl</font>
</p>
<p>PHP seems to be holding steady, or slightly declining.  But, Java is waning, as I discussed in <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>.  C# seems to be steady and slightly increasing, while Perl is steady and slightly decreasing.  So where are those Java programmers going if not PHP?  Are they going to Ruby and Ruby on Rails?</p>
<p align="center">
<img src="http://google.com/trends/viz?q=java,ruby,ruby+on+rails&#038;date=all&#038;geo=all&#038;graph=weekly_img" height="260" width="580" alt="Java, Ruby and Ruby on Rails" /><br />
<font color="#4684ee">Java</font>   <font color="#dc3912">Ruby</font>   <font color="#ff9900">Ruby on Rails</font>
</p>
<p>It looks like Ruby and Ruby on Rails are tiny fish in Java&#8217;s pond.  Perhaps those Java developers are going to C# or one of Microsoft&#8217;s unsearchable variants.  It would be interesting to see the MSN search trends.  However, there is one area where Ruby on Rails seems to be doing well:</p>
<p align="center">
<img src="http://google.com/trends/viz?q=struts,ruby+on+rails,framework&#038;date=all&#038;geo=all&#038;graph=weekly_img" height="260" width="580" alt="Struts vs. Ruby on Rails" /><br />
<font color="#4684ee">Struts</font>   <font color="#dc3912">Ruby on Rails</font>   <font color="#ff9900">framework</font>
</p>
<p>It used to be that most of the PHP frameworks were cloning Struts.  Now they clone Rails.  There is an increasing interest in frameworks.</p>
<p>There are countries where PHP is more popular.  Here is the PHP vs. Java chart for the Netherlands.  Right at the end, PHP beats out Java.  Search, <a href="http://www.derickrethans.nl/">Derick</a>.  Search.</p>
<p align="center">
<img src="http://google.com/trends/viz?q=php,java&#038;date=all&#038;geo=NL&#038;graph=weekly_img" height="260" width="580" alt="Java vs PHP in the Netherlands" /><br />
<font color="#4684ee">PHP</font>   <font color="#dc3912">Java</font>
</p>
<p>One last Trend.  What is trendier that Ajax these days?  Certainly not JavaScript.</p>
<p align="center">
<img src="http://google.com/trends/viz?q=javascript,ajax&#038;date=all&#038;geo=all&#038;graph=weekly_img" height="260" width="580" alt="Java vs PHP in the Netherlands" /><br />
<font color="#4684ee">Javascript</font>   <font color="#dc3912">AJAX</font>
</p>
<p>Notice how Javascript searches are declining while Ajax is ascending.  Strangely I would have thought that the interest in AJAX would have created an increase in Javascript searches.  It doesn&#8217;t look like the total search volume of the two terms together is increasing that much.  Looking at the news volume graph is striking.  The AJAX press release machine is in full gear.  So is AJAX the thing that everyone is talking about, but nobody is doing?  Can you say Web 2.0 bubble?</p>
<p>Please use the AJAX enabled comment form below to tell me how wrong I am.</p>
<p>DISCLAIMER: These graphs and conclusions are for entertainment purposes only. Opinions expressed should not be construed as trendy advice.  The particulars of any person&#8217;s concerns and circumstances should be discussed with a qualified trend spotting practitioner prior to making any decisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2006/05/10/programming-language-trends-via-google/feed/</wfw:commentRss>
		<slash:comments>27</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>6</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>43</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>8</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>
		<item>
		<title>PHP Development From Java Architects Eye</title>
		<link>http://www.procata.com/blog/archives/2005/04/23/php-development-from-java-architects-eye/</link>
		<comments>http://www.procata.com/blog/archives/2005/04/23/php-development-from-java-architects-eye/#comments</comments>
		<pubDate>Sat, 23 Apr 2005 18:04:02 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[performance-optimization]]></category>
		<category><![CDATA[shared-nothing]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2005/04/23/php-development-from-java-architects-eye/</guid>
		<description><![CDATA[Simple Thoughts blog has a post on PHP development from a Java architects eyes.  This post highlights the paradigm difference between programming in PHP and programming in Java:

In PHP multi-threaded programming using ticks is rather primitive, to put it politely. I couldn&#8217;t find any way to share data between multiple invocations of the script, [...]]]></description>
			<content:encoded><![CDATA[<p>Simple Thoughts blog has a post on <a href="http://blog.taragana.com/index.php/archive/php-development-from-java-architects-eye/">PHP development from a Java architects eyes</a>.  This post highlights the paradigm difference between programming in PHP and programming in Java:</p>
<blockquote><p>
In PHP multi-threaded programming using ticks is rather primitive, to put it politely. I couldn&#8217;t find any way to share data between multiple invocations of the script, without resorting to file or SQL. I missed saving in servlet context and singletons (evil!).
</p></blockquote>
<blockquote><p>
I however kept looking for a uber-global which will allow me to persist data across sessions.
</p></blockquote>
<blockquote><p>
I couldn&#8217;t find simple way to cache data in PHP. File or DB based caching was unattractive to me.
</p></blockquote>
<p>This pretty much sums up the fundamental difference.  PHP shuns threads in favor of simplicity and relies on files and databases to &#8220;share data between multiple invocations of the script.&#8221;  The author doesn&#8217;t make this paradigm shift and erroneously implies that PHP is not scalable.  At the same time, he offers this insight into the mindset of Java programmers:</p>
<blockquote><p>
I think it is because Java think-tank wants to encourage programming with resource constraints in mind. remember Java had an Oak background, a language targeted for limited resource devices.</p>
<p>The sad part is that most Java developers get bogged down by such trivialities and cannot see the forest for trees. I know, I know you are an exception.</p>
<p>Most of the time you hear Java programmers thinking of scalability and performance when his PHP counterparts are happily coding away in a world with unlimited resources (they think). Unfortunately Java developers as a group tend to get bogged down with resource conservation mindset.
</p></blockquote>
<p>There is a name for this.  It is called premature optimization.  And it often leads to code that is slower and less scalable.  <a href="http://www.procata.com/blog/archives/2004/06/30/php-scalability-and-perforamnce/">Scalable applications can be written in PHP</a>.  One just uses a different set of patterns to write them in PHP than in Java.</p>
<p>Speaking of mindset&#8230;</p>
<blockquote><p>
Overall a large part of the difference is in the mindset of a Java and PHP developer. How do you perform SQL queries in PHP? You just create a SQL statement string in code concatenating proper parameters as necessary.</p>
<p>Tell that to a Java programmers worth his salt. If he doesn&#8217;t half-die in shock, I would be surprised. &#8230; At the very least he must stow away his SQL code in a separate class and use the functionality by invoking methods in that object.
</p></blockquote>
<p>PHP pitches a large tent.  There are many amateur and professional programmers using PHP.  I don&#8217;t know many of the professionals using this technique.  Most people I know are using a data base abstraction library, such as PEAR:DB, PEAR:MDB2, or ADODB, Creole or perhaps even PDO.</p>
<p>The interesting thing is that some of the most popular PHP applications are not the ones that I would point to and tell people &#8220;this is a good example of programming in PHP.&#8221;  I won&#8217;t name names, but I would hate for people to form their opinions about PHP solely on the design of these applications.</p>
<p>I got my first paid full time programming job over the summer when I was 17 and worked as a full time professional programmer during all but two years of my college career.  Eventually I came to a realization that caused me to change my major from computer science to business.  That realization was that project success has far more to do with how closely your software meets requirements than how technically advanced it is.  I have personally witnessed far more &#8220;high architecture&#8221; projects that never finished or met the users needs than &#8220;low architecture&#8221; projects that couldn&#8217;t be made to scale when necessary.</p>
<p>That is why software built by their users, such as many visible PHP projects are, can be very successful.  They do exactly what the users would want them to do.  Then we professional programmers look under the hood and and turn a little green. However, sometimes <a href="http://www.sitepoint.com/forums/showthread.php?t=155043">worse is better</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2005/04/23/php-development-from-java-architects-eye/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>PHP first impressions from a J2EE programmer</title>
		<link>http://www.procata.com/blog/archives/2005/02/19/php-first-impressions-from-a-j2ee-programmer/</link>
		<comments>http://www.procata.com/blog/archives/2005/02/19/php-first-impressions-from-a-j2ee-programmer/#comments</comments>
		<pubDate>Sat, 19 Feb 2005 18:32:19 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2005/02/19/php-first-impressions-from-a-j2ee-programmer/</guid>
		<description><![CDATA[I ran across Cedric Otaku&#8217;s blog entry about his first impressions working with PHP as an experienced Java programmer.  Not surprisingly, he chose PHP partly because it was already available on his ISP.
He highlights syntax, available libraries  and string handling as PHP&#8217;s strengths.
He has some problems with the scoping rules and with the [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across Cedric Otaku&#8217;s blog entry about his <a href="http://beust.com/weblog/archives/000245.html">first impressions working with PHP</a> as an experienced Java programmer.  Not surprisingly, he chose PHP partly because it was already available on his ISP.</p>
<p>He highlights syntax, available libraries  and string handling as PHP&#8217;s strengths.</p>
<p>He has some problems with the scoping rules and with the lack of namespaces.</p>
<p>Reading between the lines, I also wonder if he might prefer a stricter <a href="http://us4.php.net/manual/en/function.error-reporting.php">error_reporting</a> setting.</p>
<p>Perhaps as a PHP advocacy issue it might be helpful to have a &#8216;PHP for Java programmers&#8217; chapter of the PHP manual on php.net.  I&#8217;m not sure how far something like this might go, but the <a href="http://www.php.net/manual/en/faq.languages.php">seed</a> seems to be there.  A while ago, I started to <a href="http://wact.sourceforge.net/index.php/PhpHttpResponseHandling">compare the PHP response handling</a> to Java&#8217;s HttpServletResponse.  <a href="http://wact.sourceforge.net/index.php/PhpHttpRequestHandling">Request Handling is here</a>.</p>
<p>A comment on this post is disturbing.  It calls PHP &#8216;dangerous&#8217; from a security perspective because of the recent phpBB vulnerability.  To be fair, I have to admit that the /e modifier of preg_replace is obscure.  (I&#8217;ve started compiling a list of <a href="http://wact.sourceforge.net/index.php/SecuritySensitiveFunctions">Security Sensitive Functions in PHP</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2005/02/19/php-first-impressions-from-a-j2ee-programmer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Comparison of the PHP and Java Job Markets</title>
		<link>http://www.procata.com/blog/archives/2004/10/15/a-comparision-of-the-php-and-java-job-markets/</link>
		<comments>http://www.procata.com/blog/archives/2004/10/15/a-comparision-of-the-php-and-java-job-markets/#comments</comments>
		<pubDate>Sat, 16 Oct 2004 04:35:03 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/10/15/a-comparision-of-the-php-and-java-job-markets/</guid>
		<description><![CDATA[This is a followup on Marco Tablini&#8217;s discussion of the PHP programmer availablity and my earlier attempt at defining enterprise PHP.
Out of curiosity, I cataloged the required skills for 10 Java web developer positions and 10 PHP web developer positions from monster.com.  I wanted to make the point that the constellation of skills for [...]]]></description>
			<content:encoded><![CDATA[<p>This is a followup on Marco Tablini&#8217;s discussion of the <a href="http://blogs.phparch.com/mt/index.php?p=29">PHP programmer availablity</a> and my earlier attempt at <a href="http://www.procata.com/blog/archives/2004/10/12/enterprise-php/">defining enterprise PHP</a>.</p>
<p>Out of curiosity, I cataloged the required skills for 10 Java web developer positions and 10 PHP web developer positions from monster.com.  I wanted to make the point that the constellation of skills for Java developers is very different than for PHP developers.  </p>
<p>Here are some selected results:</p>
<p>Java : avg 4.5 years of required IT Experience<br />
PHP : avg 2.3 years of required IT experience</p>
<p>Java minimum education requirements:<br />
4 of 6 CS Degree (100%)<br />
2 of 6 Bachelors degree  (33%)<br />
4 of 10 unspecified</p>
<p>PHP minimum education requirements:<br />
2 of 10 CS Degree (30%)<br />
2 of 10 Bachelors degree (20%)<br />
6 of 10 Associates degree (60%)</p>
<p>Hardly any demand of CS degrees with PHP.  Perhaps that makes CS degree holders unwilling to go into PHP, and thus makes the few more advanced jobs there are harder to fill?  where are the career advancement opportunities in PHP?</p>
<pre>
Page Authoring      Java    PHP
                    ----    ----
JavaScript          4       6
HTML                4       6
CSS                 2       8
Applets             1       0
Graphic Design      1       3
Photoshop           0       4
Flash               0       5
</pre>
<p>PHP jobs focus much more on page authoring with photoshop experience desired, CSS, and Flash.</p>
<p>Java jobs were much more server oriented.  8 Out of the 10 Java jobs required experience with a specific application server.  There is really no equivalent on the PHP side.</p>
<pre>
Practices/Libraries Java    PHP
                    ----    ----
MVC                 2       0
Object Oriented     4       3
Patterns            2       0
UML                 4       0
Version Control     3       3
Testing             2       0
Struts              6       0
Smarty              0       2
</pre>
<p>UML isnt even on the PHP job radar, sadly, neither is testing or patterns.  Struts is one of the more required skills on the java side.  Smarty was one of the few product specific mentions on the PHP side.</p>
<pre>
Databases           Java    PHP
                    ----    ----
Oracle              4       2
DB2                 1       0
SQL Server          1       1
MySQL               0       7
PostgreSQL          0       1
UDB                 2       0
</pre>
<p>No surprise MySQL dominates in the PHP world.</p>
<p>The PHP Jobs had 33 different skill requirements:<br />
Apache, CSS, CVS, ColdFusion, Crystal Reports, DNS, Database Design, Dreamweaver, Flash, Graphic Design, HTML, IIS, JavaScript, LDAP, Linux, MySQL, Object Oriented, Oracle, PL/SQL, Perl, Photoshop, PostgreSQL, SEO, SOAP, SQL, SQL Server, Shell Scripts, Smarty, Unix, XML, XSLT, e-commerce, illustrator</p>
<p>The Java Jobs had 70 different skill requirements:<br />
Applets, ATG Dynamo, Apache, Application servers, CSS, CVS, ClearCase, DB Design, DB2, EJB, Graphic Design, HTML, IIS, IntelliJ IDEA, J2EE, JAAS, JBOSS, JBuilder, JDBC, JDeveloper, JMS, JMX, JNDI, JSF, JSP, JSTL, JUnit, Java beans, JavaMail, Javascript, LDAP, MVC, NT, OLAP/Datawarehouse, Object Oriented, Oracle, PL/SQL, Patterns, Perfoce, RMI, RUP, Rational Rose, SOAP, SQL Navigator, SQL Server, Servlets, Shell scripting, SitemInder, Solaris, StarTeam, Struts, Sun certification, Testing, Tiles, Together J, Tomcat, UDB, UML, Unix, WSAD, Web Serviecs, Web frameworks, Weblogic, Websphere, Websphere Studio, XML, XSLT, e-commerce, iPlanet, optimizeIT</p>
<p>There was far more variance for Java web developers</p>
<p>There were 502 results on monster for &#8220;PHP web&#8221;<br />
There were 5000+ results for &#8220;Java web&#8221;</p>
<p>Nothing here is scientific.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2004/10/15/a-comparision-of-the-php-and-java-job-markets/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Why PHP is easier to learn than Java</title>
		<link>http://www.procata.com/blog/archives/2004/08/04/why-php-is-easier-to-learn-than-java/</link>
		<comments>http://www.procata.com/blog/archives/2004/08/04/why-php-is-easier-to-learn-than-java/#comments</comments>
		<pubDate>Thu, 05 Aug 2004 03:01:54 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/08/04/why-php-is-easier-to-learn-than-java/</guid>
		<description><![CDATA[I ran across a Novice java programmer&#8217;s mistakes and Common java programming errors page.  This is a dubious exercise, but I am going to try and use these pages to compare the learning curve of Java and PHP.
This is inherently unfair, as these are lists of known learning problems in Java that might not [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across a <a href="http://users.erols.com/ziring/java-npm.html">Novice java programmer&#8217;s mistakes</a> and <a href="http://www.cit.gu.edu.au/~rwt/p2.02.1/errors.html">Common java programming errors page</a>.  This is a dubious exercise, but I am going to try and use these pages to compare the learning curve of Java and PHP.</p>
<p>This is inherently unfair, as these are lists of known learning problems in Java that might not exist in PHP.  Please tell me, what are the learning hurdles of PHP that might not exist in Java?</p>
<p>First, the <a href="http://users.erols.com/ziring/java-npm.html">Java mistakes</a>:</p>
<p><strong>Naming the Class Differently from its File Name</strong><br />
This is an example of unwanted <a href="http://en.wikipedia.org/wiki/Quantum_entanglement">entanglement</a>: the need to keep two items synchronous across a distance.  No such filename entanglements in PHP.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Comparing Strings with ==</strong><br />
Strings aren&#8217;t objects in PHP so naive == works as expected, although weak typing can make the results of == more difficult to predict and having a === operator means more things to learn.    (see <a href="http://www.blueshoes.org/en/developer/syntax_exam/">PHP syntax exam</a>)<br />
<font color='green'>Advantage: +.5 PHP</font></p>
<p><strong>Forgetting to Initialize Object Arrays</strong><br />
PHP doesn&#8217;t require an array to be declared with a certain type, so this bit of confusion isn&#8217;t really possible.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Putting Several Public Classes in One File</strong><br />
Not a limitation in PHP.  Naive version works as expected.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Shadowing an Attribute with a Local Variable</strong><br />
Attributes must be prefixed with $this->, so it isn&#8217;t possible to shadow an attribute with a local variable, although it is still possible to forget to add the $this->.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Forgetting to call a Superclass Constructors</strong><br />
PHP has this problem as well.  Unfortunately, in PHP before __construct, there was an unfortunate naming entanglement between the class name, the constructor, and the superclass name.<br />
<font color='green'>Advantage: tie (+1 java vs. PHP 4)</font></p>
<p><strong>Catching Exceptions Incorrectly</strong><br />
I might be getting this one wrong, but I think both languages have the same problem.<br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Returning void from an Accessor method</strong><br />
The type declaration for return value is unnecessary in PHP.  Naive version works as expected.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Calling Instance Methods from main()</strong><br />
This is a variation on the simple hello world argument.  The Java hello world makes more demands on the knowledge of the programmer.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Treating Strings as In/Out Parameters</strong><br />
Again, in PHP, strings aren&#8217;t objects and the naive version works if you pass by reference.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Declaring a Constructor as a Method</strong><br />
The special __construct name eliminates this confusion.<br />
<font color='green'>Advantage: +1 PHP (tie java vs. PHP 4)</font></p>
<p><strong>Forgetting to Cast Object Data Types</strong><br />
Dynamic typing means no casting means no forgetting.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Extending Interfaces</strong><br />
Dynamic typing in PHP means that interfaces need not be declared and used as much as in Java, but I&#8217;ll still call this a tie.<br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Calling Superclass Methods and Forgetting to Use the Return Value</strong><br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Forgetting to Add AWT Components</strong><br />
N/A</p>
<p><strong>Neglecting Import Statements</strong><br />
Java and PHP both ship with large libraries.  The built in PHP functions, however, are universally available.  However, Woe to the beginner that has to re-compile PHP.<br />
<font color='green'>Advantage: +.5 PHP</font></p>
<p><strong>Forgetting to Start Threads</strong><br />
No threads, no problem.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Using Deprecated java.io.DataInputStream readLine()</strong><br />
N/A</p>
<p><strong>Assigning and passing double literals as floats</strong><br />
I&#8217;ll probably get this one wrong, but PHP has only doubles.  Thus, no problem.   (even if it did have multiple types, I think that dynamic typing would avoid this problem)<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p>Second, the <a href="http://www.cit.gu.edu.au/~rwt/p2.02.1/errors.html">Common (Java) programming errors</a>:</p>
<p><strong>Not specifying the size of a new array.</strong><br />
Arrays grow and shrink in PHP.  size specification unnecessary.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Not using correct array bounds.</strong><br />
foreach eliminates this problem.  I understand Java has an equivalent now.<br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Doing arithmetic on an instance of a wrapper class.</strong><br />
No wrappers, no problem.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Adding a value of a primitive type to a collection (a set or list) or a map.</strong><br />
Dynamic typing, primitives welcome.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Not casting the value of type Object returned by list.get(i) or map.get(key) to the required type.</strong><br />
Not a problem in PHP.  (covered above)<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Using static components unnecessarily.</strong><br />
A little nod to the static main here.<br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Not reading the next line inside a loop</strong><br />
N/A</p>
<p><strong>Creating a string tokenizer for a line before checking the line is present</strong><br />
N/A</p>
<p><strong>Reading all input before processing it</strong><br />
N/A</p>
<p><strong>Threading code</strong><br />
No threading, no problem.<br />
<font color='green'>Advantage: +1 PHP</font></p>
<p><strong>Doing nontrivial computation in a class constructor</strong><br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Not using common API methods</strong><br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Not breaking out of a loop when required</strong><br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Not breaking at the end of each case in a switch-statement</strong><br />
Fall through capability in a switch statement isn&#8217;t used and useful enough to justify requiring the extra break on each case in the normal course of events.  When fall through is used, it is confusing.  (see single point of entry argument in php goto)  A pox on both houses.<br />
<font color='green'>Disadvantage: tie</font></p>
<p><strong>Assigning constant values to boolean variables in if-statement</strong><br />
In a way, I find the naive version can be a little easier to understand.<br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Declaring variables globally, unnecessarily</strong><br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Repeating code that should be in a method called repeatedly</strong><br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Being too complicated</strong><br />
I&#8217;m tempted to knock java in general for this for things like EJB, but I won&#8217;t.<br />
<font color='green'>Advantage: tie</font></p>
<p><strong>Combining computation and input/output in a single, complex method</strong><br />
Its easy to mix html output and php.  I&#8217;ll give this one to Java.<br />
<font color='green'>Advantage: +1 Java</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2004/08/04/why-php-is-easier-to-learn-than-java/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Classpath Considered Harmful</title>
		<link>http://www.procata.com/blog/archives/2004/04/26/classpath-considered-harmful/</link>
		<comments>http://www.procata.com/blog/archives/2004/04/26/classpath-considered-harmful/#comments</comments>
		<pubDate>Mon, 26 Apr 2004 22:56:40 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[language-comparison]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2004/04/26/classpath-considered-harmful/</guid>
		<description><![CDATA[I am glad to see I am not the only one who has problems with classpaths in java.  Many of the advantages that python has over java, PHP has as well.  Lack of classpath is certainly one of them, but dynamic typing is my favorite.
]]></description>
			<content:encoded><![CDATA[<p>I am glad to see I am not the only one who has problems with <a href="http://keithdevens.com/weblog/archive/2004/Apr/26/Python.Java.classpath">classpaths in java</a>.  Many of the <a href="http://www.ferg.org/projects/python_java_side-by-side.html">advantages that python has over java</a>, PHP has as well.  Lack of classpath is certainly one of them, but dynamic typing is my favorite.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2004/04/26/classpath-considered-harmful/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

