
The Future of PHP
Last Friday there was a rather spirited discussion at the office between Kaiton (a Ruby aficionado and ex-Panmedia employee currently at Microsoft), Nesta (a python aficionado who is forced to use PHP) and myself, (an un-biased PHP user who is forced to defend it ;-). The topic of course was PHP, its woes, its past, its present and its future.
According to Kaiton, PHP will be marginalised in 2008 by more literate programming languages like Ruby, Python and even Erlang. His view is that as the web becomes more important to business, backend programmers will start to get involved in the front end and web programming will be dominated by more experienced programmers who care more about the language they code with. According to Nesta, Drupal is the only good thing that ever came out of PHP. I think that 2007 will be the year of PHP.
By the end of the argument discussion, things were kinda starting to go around in circles so I decided to try and articulate my ideas in written format so that they could be dated, critiqued and openly ridiculed, and so that a year or two from now I can come back read the crazy things I was thinking way back in 2007. It will also serve as an official record in case Kaiton wants to put his money where his mouth is ;-)
Before I present my argument, let me get a few things straight.
There are definitely some dislikeable things about PHP. The language design (or lack thereof) is far from perfect. PHP’s roots and a laissez-faire approach to adding new features early on have scarred the language with inconsistent naming conventions and function behaviour. A late start in the object oriented game meant that it took them a little while to get that feature right. Its popularity has been its Achilles heel and prevented the developers from making radical sweeping changes to normalize the language.
On the flip side there are a few unfair assertions that people tend to make against PHP. I often hear people say “you can’t build large apps in PHP, it just gets messy!”. While there is a lot of bad PHP code out there, that doesn’t mean you can’t write clean code. The PHP language does not enforce a lot rules to prevent you from coding sloppily; whether or not a language should police coders is a separate matter of debate. The fact remains however that PHP provides you with everything you need to code your applications according to tried and true Object Oriented Design Patterns. Whether or not you choose to do so is up to you.
Just so it is clear, I am not saying that PHP deserves to prosper, I am not saying that I personally want it to prosper, I am simply saying that it will prosper. Here is why:
PHP is popular. This has a couple ramifications.
PHP 4 is available by default in just about any web-hosting plan you come across. And PHP 5 availability is rising steadily.
It has been widely and heavily tested against a multitude of different environments and configurations (Hardware, OS, Database, 3rd party software, etc).
You are much more likely to have somebody in-house who knows at lease some PHP than any Ruby or Python, and it is also much easier to hire a PHP developer.
PHP 5 is “good enough”.
Regardless of what you want to say about PHP’s language design (or complete lack thereof) as it currently stands at version 5.2:
It has sufficient object oriented features for coding according to enterprise patterns.
It has deprecated the magic functions (register globals, magic quotes, etc) that have been the source of many security issues in the past an scheduled them for complete removal in PHP 6.
The Internet’s most trafficked site is built using PHP. They are heavily invested its success and are one of the major driving forces behind the PHP 6’s upcoming Unicode support. They have a presentation online explaining their rationale for choosing PHP.
This meets my definition of good enough. Far from perfect, not necessarily the best, but good enough for web work of all sizes.
The PHP Collaboration Project makes PHP better.
The Zend Framework leads by example to help solve the sloppy PHP coder epidemic and give developers a solid basis for rapid application development.
The Zend Developer Zone plays in important role by engaging the community and providing example code.
However, to me, the most important part of the Collaboration project is the new Eclipse based IDE/Debugger. A well designed, fully integrated free and open source graphical coding/debugging solution for PHP will a major step forward for web application development. One year from now many of use will scratch our heads in amazement at the primitive methods we used to employ for debugging complex web apps. The difference will be as huge as the jump from debugging JavaScript using alert messages to using Firebug 1.0 (more on that in a later blog post).
Zend knows how to compete
From a developer point of view the entire PHP Collaboration Project is an attempt to compete with ASP.NET. The combination of a Developer Zone, an IDE and a Framework are straight out of the Microsoft playbook. They are even working with Microsoft to compete in the arena where Microsoft typically dominates… distribution to the windows desktop. Zend Core for Windows will be a simple download and install and I wouldn’t put it past them to bundle the framework in as well.
On the Framework level the Zend Framework competes with Ruby on Rails, Django and ASP.Net. It covers all the typical bases MVC, ORM, Caching, JSON, etc.
On the language level PHP 5’s object-oriented improvements and PHP 6’s upcoming Unicode support give the language some more “enterprise” features, but I don’t think Zend is actually trying to compete with Java. Zend and Sun’s collaborated on JSR-223 (Scripting for the Java Platform) which will allow scripting languages like PHP to access Java objects in the recently released Java 6 JRE. When you combine this with the Java language support in Zend Studio 5.5 it indicates to me that Zend wants to co-exist rather than compete with Java.
Zend is making inroads into the corporate world
Separate and apart from working with IBM, Intel, EBay and Amazon on the collaboration project, Zend has established partnerships with the major proprietary Database vendors and created a special set of PHP distributions just for them called Zend Core; this now includes Zend Core for Oracle, and Zend Core for IBM . Not only do these types of partnerships make companies feel more comfortable using PHP with the proprietary databases they have built their business on but they also offer a number of other benefits:
Improved drivers. By working directly with the database vendors, Zend has already made numerous improvements to the PHP extensions for Oracle and DB2.
Simplified distribution and setup for those who need to use proprietary drivers (since they aren’t distributed with the standard php.net download).
GUI based management. Each Zend Core distribution comes with a web based interface for viewing the server status and managing the PHP configuration. Zend Core also comes with an updater that allows you to easily apply and rollback PHP updates.
Zend Core provides a nice smooth on ramp to support. You can download the basic system for free and then choose your level of support later on. Support for PHP may not seem necessary to most developers but it is nice to have the option in case the company you are working for wants it.
Not to be left behind, rumour has it that early this year we will see a Zend Core for MySQL as well as a brand new MySQL driver developed specifically for PHP that provides added performance and reliability. When you consider this along with MySQL’s upcoming Falcon storage engine and their extremely useful GUI tools, 2007 may be the year of MySQL as well.
The train has left the station
I have a python book here on my desk that is number 2 or 3 in my reading queue right now, I would really like to learn Ruby (but don’t see it happening anytime soon). I have no doubt that I will find both these languages more pleasant to code with than PHP, but my personal tastes have little to do with what I think will happen in 2007/2008. The PHP train is a rollin’ and my learning or loving another language ain’t gonna stop it.
What do you think? Will 2007/2008 see PHP rise or fall?
Submitted by Marc on January 2, 2007 - 4:46pm.
Just wondering.
Is this a php based blog?
Drupal powered to be precise.
Is this a php based blog?
What’s that suppose to mean? :D
Most of the people who complain about PHP are people who can’t code or use a dos prompt. The same people who can’t code in C++, complain about C++ leave PHP alone, find another programming language to vent your ignorance on.
Good post and good comments.
No matter how many developers leave PHP in favour of another language/application development framework, there will be those who are comfortable with it and won’t leave it, new developers who pick it up and like it, and those who return to it after trying and not liking other languages.
IMO, how long PHP will be around is (for the mathematicians) some formula which considers the above, and combines the future of expected improvements. Even with conservative estimates, it would seem PHP is not going away anytime soon.
That being said, the comment about good developers being able to pick up a language in two months is accurate. No matter how many languages you are comfortable with, if, for whatever reason, you have to make the switch to another, you should be able to. In general, unless you’re working with something really obscure, developers should concentrate more on being good developers, and less about the future of their language of choice.
As for 2007 being the year for PHP, that seems doubtful. It’s already big, and would have to get so much bigger for that statement to be true. With the realtive attractiveness and, in some cases “well established-ness”, of the alternatives, it’s unlikely that we’ll see such a migration to PHP that we will be able to say that 2007 is/was the year for PHP.
And what would have to happen to make it “the year of PHP”? The “achievements” that would have to be made in the PHP space for that to be true are unclear. What might be a more reasonable prediction is that in 2007 more new developers will chose PHP over any other language, or more developers will switch from other languages to PHP, or Google Search will switch to PHP. Make a “SMART” prediction and check the results in 2008.
@owen
Most of the people who complain about PHP are people who can’t code or use a dos prompt.
What?
Anyone who knows anything about PHP knows that as a general purpose programming language it falls short. No one can argue the virtues of PHP as a web programming language. The point is that as most developers/companies move most of their services to the web they need languages that can tie to their backend processes without much hassle or better yet use the same language for the backend as the frontend. Some may argue that with web services this is a none issue but that is another debate.
@Kyle
…and those who return to it after trying and not liking other languages.
Yet to see this happen but I see your point.
…it would seem PHP is not going away anytime soon.
Agreed. People still program in COBOL.
…developers should concentrate more on being good developers, and less about the future of their language of choice.
I wish more people got this. But if we are to believe the Lisp or functional purists the language you program in actually has an influence and the quality developer you become.
One of the advantages that PHP holds are the available tools that are built using it. Majority of them are opensource and if you want to modify/customise you will need to know PHP.
Kyle sez:
That being said, the comment about good developers being able to pick up a language in two months is accurate.
No arguments here.
Kyle sez:
As for 2007 being the year for PHP, that seems doubtful. It’s already big, and would have to get so much bigger for that statement to be true.
Ok, let me qualify what I mean by “the year of PHP”. Keep in mind that the context of the original discussion was an informal conversation with varying definitions of success and failure being used. I guess for a wider audience some more specifics are in order; However I am not going to try and conjure up some super specific stats or predictions because I frankly don’t know/trust the “popularity” numbers and I have no idea what Google plans to do (I sure hope they don’t plan on using any interpreted language runtime to replace their existing indexing and query execution architecture). On to the specifics:
When I (misleadingly) say 2007 will be the “year of PHP” the focus for me is mostly the important milestones that Zend will achieve in 2007 to ensure PHP’s continued prosperity (PHP6, IDE, Framework, Partnerships). I think PHP’s popularity would have continued to grow in anyway 2007 based on existing momentum but I think this will be the year PHP crosses over to become a long distance runner.
Contrary to Kaiton’s beliefs, I think that as more companies begin to expose their “business process” to the web PHP usage will increase rather than decrease. I expect to see Ruby and Python to be popular amongst web focused startups but I expect the vast majority of organizations will choose PHP and a lot of that will have to do with the company standing behind it.
I expect the IDE and framework to see good adoption in the 2007/2008 timeframe (not going to make guesses about millions of downloads). This will be significant because it will mean (a) traditional PHP coders are embracing better practices and (b) “mainstream” (.Net and Java) programmers are using PHP.
I expect Zend to do very well financially and get a few buy out offers in 2007/2008. A large part of this will be due to support contracts for Zend Core and license fees for the Zend platform.
I doubt these predictions are sufficiently “SMART” for Kyle’s tastes, but if I said anything else I would just be making it up. My overarching prediction is that Zend will change the corporate (and by extension the overall) perception of PHP from a quick and dirty hobbyist tool to a powerful, reliable, supported product, in a similar vein to what RedHat (and IBM) did for Linux and what MySQL AB is doing for MySQL Server.
what? why would you want php to be general purpose? it isn’t, what are you arguing about? C++ is probably the only high level, widely use general purpose programming language. Every language has their niche and reason for being. There is no one solution for every problem and a IDE does not a language better than another make.
Nice references. Good post overall.
First a clarification. Drupal is the only good thing that came out of PHP that I’ve used and by used I mean work with at a low level.
Now…
Does not exist. :)
The problems with PHP are well documented and I won’t go into them here. PHP’s main challenge at the moment is trying to curtail the number of developers leaving the language for a more comfortable environment compared to the number of persons learning the language. Gone are the days when the first (web) language a developer learned was PHP. The alternatives are becoming a lot more accessible and accessibility was one thing PHP had going for it. PHP being ubiquitous will no longer be an issue.
Agreed. And they generally don’t like PHP. People using RoR knockoffs such as CakePHP will soon realise that the effort it takes to get things done with the knockoffs would be much better spent working in the environment they are trying to imitate. Ironically most of these frameworks (Django, Rails) were built out of a frustration of using PHP.
PHP’s good enough status just won’t be able to cut it anymore. I can’t speak to Corporate and their backing of PHP. Companies like Yahoo! and Digg that chose PHP as their primary web development language usually have highly skilled (PHP) developers working for them, this does not reflect the general landscape of web developers. I mean Yahoo! has the creator of the language working for them! (Same goes for Google and Python). Developers like these may not need protection from shooting themselves in the foot but the average web developer certainly does.
Will PHP still be around 5 years from now? Unfortunately yes. My dream of PHP dying a quick painful death won’t happen anytime soon. According to this article the demand for PHP programmers actually grew in 2006 and will continue to do so this year (being part of the Drupal community I’ve actually been witnessing this first hand).
Job security is a good reason to know PHP but I can’t think of another legitimate one at the moment. The fact of the matter is PHP is going nowhere for now but its usage will surely drop over the next two years, by how much I don’t know.
With that being said; I don’t hate PHP (really), my preferences just lie somewhere else.
One more thing. The point that a developer is more likely to know PHP than Python or Ruby is only valid to an extent. As I’ve said a few times, any developer that is not able to pick up a new/better language within a short period (apprx. 2 months) of time isn’t worth the chair he/she sits on. See here for the journey of one of the many developers switching from PHP to Python.
Cheers!