PHP Needs a Foundation

October 28th, 2009

PHP-ZendOver the years I have moved from technology to technology based on the popularity of a new language or platform because that how you keep finding work. In high school and college I was taught Basic, Turbo Pascal, COBOL and a little C. In college I taught myself Perl and Java which is what I actually used when I got my first internship and my first couple of jobs after college. For a short time I got into Java and I really liked JSP, servlets and the maturing taglib system. Unfortunately Sun started to propose JSF but did not really put much energy behind it and it still has yet to make an impact. Other web frameworks for Java like Struts, Tapestry and so many others dominated over JSF because people were using them and they worked. As a consultant at that time I found it very difficult to know all of the available frameworks to any reasonable depth to confidently call myself an expert on the Java platform as web developer. It did not help that Sun did not really put much energy behind Netbeans, their IDE which was being developed by a team of developers who built it using Emacs. So IBM and their contribution to the Java landscape, Eclipse, took an leadership role in the community where Sun left a massive vacuum.

Why am I recalling this history about Java when the post is supposed to be about PHP? Well, I really liked Java and thought I was going to build my career on it, but it turned out that there was not a sufficient force behind it to keep it moving forward. And while I see PHP as a dominant player among web site development, I do not see the sorts of efforts underway to advance the platform.

In contrast, I have been working with the .NET Framework which has teams of developers working to make my work easier. One solid example is the release of ASP.NET 2.0 which was in beta when I was building an e-commerce from the ground up. I need a way for users to log in and also manage a database of users. During the ASP.NET 1.0 lifetime Microsoft learned that developers often had to build all these pieces themselves so they created the Membership Provider and the Login Controls so that you could be up and running within minutes. I was past these requirements quickly and was on to the specifics of the site and leveraged many other features that came with ASP.NET 2.0, such as Master Pages and the new caching features. I was able to create a site with rich features that was really quite fast and my client was very happy.

You might describe these improvements as framework updates because they added some libraries but they also added some tools as well as rich support in the IDE, Visual Studio, so that I could get up and running quickly. The release of Visual Studio 2005 was coordinated with the .NET 2.0 release so taking advantage of all of these features was simplified. Meanwhile IIS, the web server, was also updated to leverage .NET 2.0 features. It was an end-to-end update.

Now you could contrast the benefits of a well coordinated release which truly did make my job a lot easier with how new features trickled out from the Java community. If Sun were to release JSF with a whole series of useful controls along with supporting features in Netbeans and the Tomcat web server it could have energized a lot of developers to get on board and get them all moving in the same direction. It just did not happen. Now I find it hard to find a Java developer who is still doing a lot of work with Java. Many have moved on to Ruby, Python or PHP.

So what about PHP? Sure Yahoo! and others employ some of the core PHP developers and allow them to continue working on the language, but what about developer's needs beyond the language? What about a rich IDE which is synced to support new language features? What about releasing rich libraries which solve the most common developer concerns?

What I see is large projects like Wordpress and Drupal growing up on top of PHP, with their own communities as a structure onto itself. People build on Wordpress or Drupal as the platform, using tools in the web application itself to make changes to the platform through extensions or plugins and custom modules which just happen to be written in PHP. There is no IDE and there is no need for the PHP community to have role in this space. But there is an opportunity here for the core PHP team to provide support to platforms like Wordpress and Drupal.

Over the last year I have asked PHP developers a lot of questions. I often ask them what they use to edit PHP code and they all have a different answer. I personally edit it with VIM with color support because I often have it on my FreeBSD server. Others use Coda, DreamWeaver, Eclipse or Aptana Studio. It seems there is no clear IDE of choice.

I also find that people do not describe themselves as PHP developers. Instead they say they are Wordpress or Drupal developers and they work largely within the web application to "develop" the web site. I am not sure if many of them touch actual PHP code that often. There is nothing wrong with that, but it is very interesting.

Back when Netscape open sourced their web browser they created a new organization to watch over it. It became Mozilla which is now largely known for Firefox which has become a very popular web browser which innovates with new features from HTML5 as well as a rich extension model. This organization makes money through a search engine deal with Google, which allows them to focus on making a great web browser. I like that model. The goal of the company is to make a great web browser. They are not a small group of developers working for a big web-based company that simply allows them work on their little open source project. There is some urgency that they compete with others like Internet Explorer, Safari and Chrome. This competition drives them.

So back to PHP, I know that some PHP developers work for Yahoo! and they can focus on the language, but maybe they should form a foundation that is similar to the Apache Foundation which receives sponsorship money and support from several companies while continuing to produce software which is widely used and respected. I believe the Apache Foundation is the most respectable and most important open source organization there has ever been. It has essentially ensured that no company has been able to take over the web as their own proprietary platform and kept it open and honest. This group has also played a big role in moving the web forward. What could something called the PHP Foundation do?

For starters, I think they could work to refactor out the best features of the most used PHP applications so they can leverage a common code base which continues to improve over time, possibly with rich support from a common IDE. New features could be planned, announced, beta tested and released at a major PHP conference which includes Wordpress and Drupal which have been holding their own separate conferences. The entire community should be unified, not fragmented.

I realize that choice is important for some, but do you really need 37+ MVC frameworks for PHP? What if you had a mature MVC framework that was planned through the PHP Foundation after gathering community feedback, beta tested and then released after providing time for IDE developers for Eclipse and Aptana Studio to support these features? I think you would start to see some real energy behind the platform and innovation that you just are not getting right now from PHP as a language.

As a part of this PHP Foundation they could take on other open source projects and bring them into platform. After MySQL was bought by Sun and then pulled into Oracle and subsequently forked to get it away from Oracle the PHP Foundation could be a good new home for what is the newly forked MySQL. And what about continued integration and the Apache Foundation and the Apache web server which works well with PHP now, but there is so much more it could do.

What I would also like to see is a Just-In-Time Compiler for PHP which we have been seeing with JavaScript in Firefox, Chrome and Safari lately. Does a JIT for PHP exist already? It is under development? Could a PHP Foundation fund this development? And how much would a dramatically more efficient PHP runtime be? Yahoo! and other major providers using PHP would not need as much processing power that they have now if PHP was JIT'd.

But why does this matter to me if I am happy working with .NET/Mono? Well, I prefer to work with HTML, CSS and JavaScript which are web standards but there is no official server-side programming language. Back in the late 90's the de facto standard was Perl and these days it seems PHP has grown to become modern de facto standard. If that is the case, there is a good chance I will be making a move to work in PHP in the future. But I do not want to move to just a language. I want an entire platform that has vision, energy and a plan.

I also see an opportunity for the PHP Foundation to release reference applications of good PHP architecture that shows how the best PHP developers do it and how you should do it as well. Along these sample web sites I would want tutorials which train everyone to write good code in PHP. Over the past 2 years Microsoft realized that the ASP.NET community wanted MVC, so they developed it as open source and released it. On the first day it was able to run on Linux with Mono and you can learn how to use it with the ASP.NET MVC Training Kit. Beyond the training kit there are written and video tutorials available.

This is what I see is missing from the PHP community. Sure the developers have jobs which allow them to work full time on the language, but do they have teams producing sample projects, writing papers, preparing video tutorials and organizing workshops and conferences to train the community about all of the latest features of the platform? If I saw this happen, I would find it to be a very appealing community and platform.

I am interested in what you think. I realize I do not know everything about what is going on with PHP, so please fill me in. What is going with PHP that you think is going right? And what do you agree could be done to improve on the PHP ecosystem?

[ Image courtesy of Creative Commons and calevans. ]

4 Responses to “PHP Needs a Foundation”

  1. Jason Says:

    First thought, it looks like a lot of reading. Which is good cause I'm still eating. Cherrio.

  2. Jason Says:

    Ok. Great overview and history of your past career. Since I have meet you it seemed like you were on the fence. Regarding the focus and future of PHP I don't have all the answers, I think because it is so open and broad it's hard to focus a strong direction. But I think MySQL and PHP have always gone hand and hand MySQL lite has opened up many doors to client storage with small databases. I have no question this will continue.

    I started out learning ASP many years ago and automatically wanted out after the small consistant problems with IIS and lack of a open community. For PHP I watch videos and podcasts almost daily. There are some great developers continuing to develop stronger libraries. To me people developing PHP seem to be more in touch with other developers and more wanting to learn.

    I really like Wordpress and have been building around it with any news sites but only for the past 4 months. I strip away the styles and start building my own. I don't know if you would call Wordpress a set of plugins or what. Two reasons I will continue to use it. 1. Mobile site conversion. 2. It's developed on PHP.

    That's my input. M$ scares me because they control .NET and then there is the additional costs.

  3. Brennan Stehling Says:

    First I would say that Microsoft has allowed the community to open up a lot. Over the past year a few of the ASP.NET frameworks were developed as open source. ASP.NET AJAX and ASP.NET MVC are openly available and run on Mono which is on Linux and MacOS X. I really like having that option, especially with my new MacBook Pro. In a recent project I set up ASP.NET MVC to host some web services which return JSON for an iPhone app. It is very easy and it all runs on my Mac and I can work with it in MonoDevelop. At the last PDC in LA Microsoft had Miguel de Icaza give a presentation, which is the first time a non-Microsoft employee has spoken at PDC. And since he created and is the leader of the Mono project that was an especially big deal. He did a demo of some amazing features in Mono and then showed a Mono app running a game on an iPhone. I think that is a great example of how how Microsoft has become.

    Now I want to see something like the organization that has drawn me to the .NET platform to show itself in the PHP community. Locally I am exposed to some people working with Wordpress or Drupal, but I do not see a lot of serious development done with it. Another key reason I do not take PHP seriously that it is just for web sites. Sometimes I need to build utility applications and being able to build a schedule process or desktop application in the language that I use regularly with the tools that I know best is a great asset.

    And typically my problem with some other technologies is fragmentation of effort. With Java the diverse set of web frameworks which were not working together was causing me to spread myself too thin. It also meant that different developers could not help each other much because your problem was related to Struts and the other developer only knew Tapestry or you were using Hibernate and the other developer was using JDO. A community of 100 people going in 25 different directions really becomes 25 different communities without a shared vision which hampers momentum.

    In contrast, there was a project gaining ground with the .NET Framework called MonoRail. It basically was becoming a popular MVC alternative to the PostBack model which was dominant among ASP.NET web sites. Microsoft saw it's popularity rise and decided to create ASP.NET MVC. They did not do it to destroy MonoRail, but actually incorporated much of MonoRail into the design of the project. The dilema that many .NET developers have is that the are not allowed to use just any open source software, but if it comes from Microsoft it is alright, so by incorporating MonoRail into ASP.NET MVC they allowed developers to get what they wanted and also allowed Microsoft to keep the developer community from breaking into pieces like Java did.

    The other day I saw a PHP developer working on some PHP code that did not look like any PHP I had ever seen. He even seemed to be working in a fairly decent IDE. I see that PHP 5.3 now has one key feature that I consider a must, namespaces. That is a milestone to me. It is like when MySQL got stored procedures. Today I do not think PHP is near where I want it to be, but I realize it meets the "good enough" criteria for most things. I run Wordpress for my blog. It works pretty well for me. I use to run MovableType which is built on Perl. I mainly switched because I felt that Perl had stalled and Wordpress really had some killer features that I wanted. I think the key feature was URLs for blog posts which were readable in my stats. And years later Perl 6 has still yet to be out as a beta. It has been 10 years in development and that continues to be my primary cautionary tail.

    Do open source projects die? No, they become like Perl 6 and start to move extremely slowly. We might have stable release of Perl 6 in 2 years. The primary developer is non-committal on calling any version stable. He should least commit to an alpha, beta-1...beta-n process so people at least try it out and provide feedback. But oh well. I will not be using Perl anymore. I have moved on. In 10 years we have gone from CVS to SVN and now Git as well as .NET 1.0 to 1.1 to 2.0 to 3.0 to 3.5 and likely 4 before Perl 6. So having a business behind your platform gets results. And that is what I am looking for from any platform I will consider in my future. Perhaps I will choose Ruby, but maybe Microsoft will continue to open up and .NET will eventually collaborate even more to Mono and it will become that platform I have been waiting for all this time. Still waiting...

  4. Servefault.com Says:

    PHP Needs a Foundation...

    Thank you for submitting this cool story - Trackback from Servefault.com...