Development, PHP @ 03 September 2005, “No Comments”

Despite all the cleanliness and standards obsessed nature of Java, PHP still has the advantages that its quick to learn, develop and execute. As such it is a favorite with media agencies and smaller dot coms, but since PHP can be as dirty as perl (well, not quite) and almost as elegant as java, a whole range of code is produced, all of which has to be supported by successive employees.

I feel the problem is that there is no clear standards that are set in place, and no manner in which to easily relate them to people. For example, as new employees start, it would be nice if one could point them in the direction of a website that describes some decent standards to follow. When I speak of standards, I do not mean where your curly braces go, but how one should write an application such that it can be deployed without the application server needing hours of (long forgotten) configuration, and that prospective employees, current ones, and in fact everyone, is on the same page when it comes to frameworks and specifications.

Java has a nice community process in place to create expert groups to analyze and propose a generic solution for a particular problem domain (servlets, portlets, etc etc). The specification is merely a set of well-known interfaces (and where code is insufficient, documentation embeleshes) that must be implemented (correctly) for your application to conform to that standard.

In this world, open source projects, pear libraries and everyones code would all work together, and I would not have to bend over backwards to work in the way that one particular project would like me to work, let alone trying to get two projects to work together (such as Propel, Torque/Java-esque, and Prado, ASP/DotNet-esque).

First, a specification would be drawn up for the standard layout of a php (web) project, this would be much like a jar, but not compressed, containing code, templates, license information, configuration, and any other assets that are needed.

Next a php. top level code library that contains abstract base classes, generic pattern-implementations, and utilities (not disimalar, but not necessarily the same as java.io, java.lang, java.util etc etc).

Furthermore, a servlet-like (although perhaps much simpler, no dispatchers, filters, etc…) specification that would allow web applications to run on anything from a traditional and very simple apache/php server environment to running in some kind of proprietory enterprise clustering environment.

Ultimatley, ths community process would allow this by creating community-based, peer-reviewed, standards, that take a higher level approach to solving problems than just whatever fits.