Narendra Dhami

My Site

Open-source Web applications, PHP vs. Java (Part 2 of 2)

Posted by Narendra Dhami on July 23, 2008


The first part of this article reviewed some elevant open-source Web applications in both the PHP and Java worlds. The conclusion was that there are massively popular PHP projects and somewhat popular if not obscure Java counterparts. I’m a Java fan and it pains me to discover this reality. The user comments also underlined this feeling.

Is it the technical merits of PHP?

In my experience, the technical merits
of PHP are below those of Java as a language and as a runtime environment (standard API, virtual machine).

Compared to Java, the code quality of PHP projects has a faster decreasing rate as the codebase size grows. The root cause is that PHP was created to solve small size problems and
this makes it difficult to manage larger projects.

PHP 3 and 4 had basic object-oriented
features, while PHP 5 improved them considerably, both at the language and the runtime level. There are several PHP MVC frameworks to ease the structuring of larger projects, but these are most effective when running on PHP 5. Most popular open-source PHP projects still run on PHP 4 and tend not to use MVC frameworks at all.

Looking at the staggering number of plugins available for the popular PHP open-source projects, one could conclude that their code is easily understandable and that PHP has well-rounded application extension mechanisms. Well, not exactly true.

The typical PHP extension mechanism is procedural and works like this:

  • list the subdirectories of the extensions directory,
  • analyze the predefined directory structure for each extension,
  • execute some predefined PHP files that should auto-register their resources and actions.

More …

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: