PHP's Enterprise Strengths and Weaknesses, Take 2

Zend's John Coggeshall responds to CIO.com's earlier PHP article with his own list of the Good, the Bad and the Ugly of PHP application development.

By John Coggeshall
Fri, March 14, 2008

CIOEditor's note: Some readers disagreed with the points made in our previous article, You Used PHP to Write WHAT?! in our series of the pros and cons of each dynamic language. We invited John Coggeshall, senior member of Zend Technologies' Global Services Group, to provide his own enumeration of the dynamic language's suitability for enterprise computing—both its advantages and disadvantages.

Just as a carpenter will tell you that it is much better to use a screwdriver rather than a hammer to secure screws into a wood plank (although arguably both would work), an experienced programmer will say that certain languages are better than others at certain things. So, in the digital toolbox of the developer, where has PHP been designed to work best? And where is it, perhaps, not the best tool for the job?

PHP was designed to solve what I (and others, such as PHP's creator, Rasmus Ledorf) call "The Web Problem," by which we mean the challenges found in the creation of dynamic server-side applications on the Internet or on an intranet. PHP was created to—and continues to evolve to—solve this single problem, which perhaps is the biggest reason why it's been a (if not the) Internet programming language of choice for such a long time. In fact, PHP is the fourth most popular programming language in the world, according to the TIOBE Programming Community Index, above C++, Perl, Python and Ruby. (In all fairness, this probably represents the reality that more people are writing web applications and are turning to a language designed to solve that problem.)

While other languages can surely be used to solve The Web Problem, in this article I explain why PHP is the premier solution for server-side Web scripting.

The Web Problem and PHP

Unlike most programming languages, PHP was designed to function within the challenges of Internet development, which include statelessness, heterogeneousness, typelessness, and the short shelf life of transactions (that is, after all: a typical Web request lasts only a fraction of a second).

For example, PHP is a loosely typed language, which means a variable can switch from one data type to another. This is often a point of criticism for PHP, as developers coming from a traditional background would consider such a behavior sloppy and unpredictable. However, for The Web Problem, such behavior makes sense; after all, the data has no type coming in or going out so why should it have a fixed type in between? The biggest reason might be to add rigidity to the application, but I would argue such rigidity applies only to object oriented programming itself—and to that end PHP does support type hinting for complex types (such as classes, arrays and interfaces).

The Web's stateless nature affects one architecturally significant difference between PHP and other Web languages. Without state, your "Web application" isn't really an application at all. Rather, it's a collection of atomic, individual and completely disparate scripts working in unison to represent a holistic application with no direct way to communicate with each other. To further complicate the matter, multiple copies of a single script can run concurrently for different users; you have to distinguish individuals from each other. (That's where cookies come in, incidentally.)

Plus, each Web request script typically is built, runs and is destroyed within a fraction of a second. Only in a unique set of circumstances would a "traditional" development language be suited for this environment.

Every development language has a different solution to this notion of state. In Java, state is created by maintaining a persistent virtual machine backend. using an application server, to which each front-end Web request must communicate. The application server almost always requires dedicated hardware resources and can be a single point of failure. Plus, it is inefficient to open a second network connection for every incoming network connection, which often then results in a third network connection if the application server business logic must communicate with a database backend.

PHP takes a more simplistic approach because it was designed to live and die within the context of a single Web request. PHP instead relies on standard HTTP technologies, such as GET/POST variables and cookies, to "remind" a given PHP script what its state was (often stored in a database backend, although commercial products such as Zend Platform provide enterprise-ready session clustering alternatives). This architectural simplification has a significant impact on overall application complexity and performance—an impact that could not be achieved in a language originally designed assuming state and a long-running process.

Next: Platform Support and Security

Continue Reading

With 1.5 billion instructions in one second (BIPS), while consuming less energy than ever before, Wintergreen Research says IT departments need to sit up and take notice of this hybrid system that combines the System z with servers.
Learn how your answer to this question compares to your peers by taking this quick poll. See how your peers are dealing with the challenge of ensuring a highly capable server infrastructure as technological shifts impact the application server platform.
With increasing data growth, comes increased need for data security.  The existing DLP model, with a focus on compliance/enforcement is not sufficient as the data discovery and classification capabilities are not granular enough.  Read this paper to find how you can efficiently and accurately manage your risk by rapidly inventorying and classifying your data and then developing remediation workflows that support business needs. 
This paper breaks down attack sources into four categories: external, malicious insiders, accidental insiders, and unknown.
The rapid growth of data and technology is creating challenges for organizations as this digital data is considered to be business communications and must be preserved according the same industry-specific regulations governing the retention and discovery of emails and more traditional forms of electronic communications. This paper examines the role that Data Loss Prevention ("DLP") technology can play in helping organizations address the challenges of locating information in response to electronic discovery.
This research, conducted by the Ponemon Institute, focuses on issues relating to the use of data protection solutions such as endpoint encryption and data loss prevention within the workplace.
As greater numbers of datacenter servers transition from the physical to the virtual world, the components of virtualization success come to the fore. What scores of organizations have discovered is that success is derived from an optimal pairing of the right software platform with the right hardware platform.
Have you been looking to hear about customer's experiences with the new VMware vCenter Site Recovery Manager product? View this webcast to learn about VMware customer, Navicure, and their experiences testing and evaluating the recovery manager, their progress in implementing it in their environment and their advice other customers considering using vCenter.
Many enterprises have discovered that the use of virtualization to support desktop workloads creates a range of significant benefits. These benefits include price efficiencies, improved IT management and greater agility and choice for end users.

This VMware sponsored webcast with IDC will provide both quantitative measurement of the business value -- defined as the expected ROI -- and qualitative analysis associated with the use of VMware View™. IDC will also provide an analysis of the View Composer and ThinApp™ features of VMware View, including the business value of these solutions and an overview of how they work.

Attend this webcast to learn about:
- Challenges and barriers that might impede the adoption of desktop virtualization
- Navigating roadblocks to facilitate a strategic implementation
- Optimizing qualitative and quantitative benefits to IT and your business
VMware recently announced VMware vFabric™ Data Director, a new database deployment and operations platform that enables enterprise IT organizations to offer database as a private cloud service. Built on top of VMware vSphere 5, vFabric Data Director enables IT organizations to ontrol database sprawl through automation and consistent policy enforcement and accelerate application development cycles with self-service database management. Attend this webcast to learn how vFabric Data Director can help you build database-as-a-service in your datacenter.
A simple, cost-effective disaster-recovery solution for virtual environments is high on the agenda for IT organizations as they virtualize more business-critical applications with VMware. VMware vCenter™ Site Recovery Manager-the market-leading disaster-recovery product-ensures the simplest and most reliable disaster protection for all virtualized applications. VMware vCenter Site Recovery Manager provides centralized management of recovery plans, enables nondisruptive testing and automates site-failover processes.
Traditional disaster recovery solutions are often too expensive, complex and unreliable to meet business requirements. As a result, IT departments are hesitant to expand disaster protection beyond their most critical applications, largely because they are uncertain whether the quality of the protection is really worth its cost. VMware vCenter™ Site Recovery Manager 5 is the market-leading disaster recovery product that addresses this situation for organizations of all kinds. It complements VMware vSphere to ensure the simplest and most reliable disaster protection for all virtualized applications.
Newsletter Sign-Up »

Receive the latest news test, reviews and trends on your favorite technology topics

Choose a newsletter
  1. View all Newsletters | Privacy Policy
Resource Center