Java under attack?
Since the late nineties, the Java community has recognized some major
issues with the use of Java as a server-side engine for generating
HTML "on the fly". The most famous article (published on the Java
site servlets.com) was entitled, "The Problems with JSP". This article
was somewhat controversial, given the popularity of Java.
More recently, Java has come under attack from two sides: Microsoft's
.NET initiative (and specifically, ASP.NET) and what some have termed
LAMP (Linux, Apache, MySQL, PHP). Given the exploding popularity of
PHP as a multi-platform web appplication server, others have begun to
more closely examine PHP's viability as an enterprise development
platform.
PHP as a replacement for enterprise Java applications
Regular readers of the BadBlue Report will recognize an updated list
of companies using PHP (below), the trend for which indicates that PHP
is becoming a major player in many large IT organizations. Further,
when costs are factored in, the differences between PHP and Java are
brought into sharp contrast.
When eWeek benchmarked PHP against JSP pages, the differences were
stark: driving the same dynamic pages, PHP executed nearly four times
faster. The results for budget-conscious IT organizations are worth
noting - less costly hardware expenses for a given application.
Additionally, studies contrasting the development time required for
complete, equivalent web applications (given experienced resources)
have demonstrated that PHP developers finish tasks two to three times
faster than Java developers. This is not due to the skill of the
developers but rather to the applicability of the tools to web
applications (sources: eWeek, PerlMonth, respectively).
PHP's viability as a language
Certified Java developer Abdul Habra recently surveyed some of the
language features of Java/JSP vs. PHP and published the results
(http://www.tek271.com/articles/JavaOrPhp.html) in an interesting
article. A response published on the PHP.NET site raised some
questions regarding the article:
"Your comparisons are interesting and well thought out. I would also
add some higher-level (less 'computer-science' in nature) simply
because the task at hand is generating web pages 'on the fly'). As a
pure CS language, there is no doubt that Java is superior. But as a
web page generator, I have moved from a Java-centric approach to PHP,
leveraging servlets or beans as needed "under the covers".
Therefore, some higher-level things to consider:
1) Compare the complexity of real-world production applications
(postnuke.com vs ? in content management, phpbb.com vs. ? in
discussion boards, jpgraph vs. ? in graphing). In my mind, the proof
is in the pudding - which technology results in the better, more
production-ready applications? They may be out there for Java - I
would just like to know where they are and who is using them.
2) Compare slinging (generation) of markup which is where PHP excels
(as it was designed to sling markup - this includes features such as
character transformations, variable accessibility, web page captures
(see the fopen call which captures a web page in a single function
call). Your point about a string being encapsulated in a string class
is somewhat irrelevant if you are a programmer cranking markup.
Embedding object-oriented code into a page can be more painful (and
slower to execute) than leveraging traditional coding techniques.
3) Compare native database and directory support. Java would have the
advantage in generic database access (JDBC) but PHP has the advantage
in LDAP support (JNDI has several bugs which we have run into - quite
painful) and native database access (e.g., Oracle or MySQL
integration).
Overall, well done - and a very popular topic! It's worth building it
out further."
Our hope is that these comparisons become more rigorous and complete.
Companies using PHP
We'll wrap up with our traditional list of significant organizations
using PHP. Two new entrants: Hewlett-Packard and Deloitte Consulting
are now included.
CapitalOne, NASA, the W3C, HP, Google, Deutsche Bank, Redhat,
Lycos, Cisco, Ericsson, Volvo, Motorola, SourceForge, Honda, Xoom,
WinAmp, Sony Music, Vodafone, CBS, Cap Gemini Ernst & Young,
the US Army, UPI, the New York Yankees, Southwestern Bell,
the San Diego Zoo, the Oakland Raiders, Audi, Subaru, VA Linux,
Winamp, Duke University, Quicken, The Village Voice, Undernet,
Access Micro, Columbus Dispatch, Indianapolis Star,
Indiana University, Deutsche Telecomm, Bang & Olufsen, Siemens,
Unilever, Philips, BMC, NTT, Air Canada, Lufthansa, Dialpad, BMC,
Mitsubishi, MP3.com, the Arizona Republic, Deloitte Consulting
By the way, if you missed last issue's PHP Watch article (entitled,
'The Business Case for PHP'), it seemed to be very popular, turning up
in several software development sites. The article can be found here: "The Business Case for PHP".