On PHP

I just finished a two day PHP training with Keith Casey (Casey Software) with Blue Parabola and a key contributor to web2project and and thought I would write down my thoughts and notes before I forget everything. Here are some quick observations:

PHP:

PHP is all about getting stuff done and there are many different ways to do many different things. This is good and bad. There is no central source of information such as MSDN for PHP developers. The best way of getting up to date on the latest information is through your local user group and by contributing to projects and getting code reviews. Many junior developers do not come from a CS background and will do things the wrong way the first time. They are dependant on senior devs showing them the ropes and chewing them out for mistakes.

Apps: 

PHP in my opinion kills anything on the Microsoft stack as far as getting pre-built app up and running. We watched a wordpress install from dreamhost with an added theme and a google SEO plug in go from start to finish in about five minutes. There are many other viable apps that can be configured in a similar manner such as the well known Joomla, Drupal and others. Configuring these apps is a matter of clicking one or two checkboxes and hitting go. Dead simple and very impressive. Web PI is our best response for pre built apps and it is ideal for setting up a .Net or PHP environment but we do not have anywhere near the hoster support or widespread app adoption that PHP has. I think the Orcard project is a great response here and hopefully this app can develop a strong community following and is dead simple to set up and configure from a hoster such as discountASP or GoDaddy.

Groups: 

The PHP community can be broken down into four groups.

  • Designers: mainly work in Photoshop and might have some knowledge of HTML and CSS
  • Themers: limited knowledge of HTML and CSS, responsible for setting theming pre-built applications
  • Configurers: limited knowledge of PHP, some javascript knowledge, responsible for configuring plugins for pre-built applications
  • Developers: varying knowledge of PHP, can write plugins, write from scratch, contribute to open source projects

Developers are small in amount to the the other three groups because one plugin can be utilized by many many configurers. A typical model for a mom and pop bakery is to charge 500 bucks or so and set up a quick and dirty site with some limited theming and perhaps a logo. Developer does not need to be involved here and is also not cost feasible. For Orchard to compete with this model, developing a viable plug in ecosystem will be huge. Drupal rule #34 is that there is always a plug in for that. This means in the vast majority of cases, no real developer/programming experience is required for CMS and Blog application development. At this point, I don't think there is a .Net solution that can say the same thing.

The Language:

In general, PHP is not elegant. Developers with a computer science background would probably prefer using a framework such as ASP.Net MVC, Rails, or Django. However, we did not explore CakePHP much but I think it might help smooth out a lot of the rough stuff. We looked at developing a log in page with client and server side validation and there did not seem to be standard design patterns in PHP that would help a new developer avoid mistakes and securtiy vulnerabilities. It seemed that the only way to write good code is to write poor code and get criticized by more experienced developers. A goal of frameworks is to steer developers in the right direction, for instance, separation of concerns is the path of least resistance in ASP.Net MVC and client and server validation are both very clean. With plain PHP, the main development process for new developers is to search for a snippet online, tweak it for your needs and be done with it. Again, I would like to see CakePHP because I have heard a lot of cool things about it.

The IDE:

Developers might prefer NetBeans or Eclipse, a big factor is where the developer is coming from. For instance, a Java developer would probably use Eclipse and a Perl developer would probably use EMACS. Must have features are code completion/intellisense, go to definition, deployment, source code control integration, coloring, find all references, possibly javascript intellisense/debugging, and debugging in general. Interstingly, many PHP developers do not use a debugger, XDebug seems to have some pretty cool features but many developers think the feedback loop is quick enough with print statements and var dumps and don't want to be weighed down with a debugger. There are also some other cool tools that count duplicated code and measure code complexity but most novice developers do not use these tools.

The Community:

The top guys in PHP contibute to mulitple open source projects and often run large teams of developers as their main job. Contributing to open source projects is useful for major players like Facebook because they need the changes anyway. Contributions generally are made for the purpose of scratching an itch. For the smaller guys, being a key contributer on an open source project is a source of reputation in the community and a built in resume. Furthermore, it allows the developer to charge higher rates to deploy the app and customize it for a customer. It was very interesting to hear so many details about the open source model and why it works. There are a lot of positives such as strong community and constant improvement, but also some negatives such as the lack of a central communication channel and the prevalence of projects that are dead, stalled or bug ridden. There is a strong survivorship bias around major PHP apps such as Drupal and Joomla, there are hundreds of apps that have died out and these have been in development for five plus years and have only somewhat recently been taking off. This makes me think that getting Orchard to this level will take a lot of hard work but it is an absolute must to have any chance of competing with PHP for the audience below developers.

 Overall:

I learned a lot of fascinating things just by listening to Keith's experiences and opinons on PHP. Being able to ask a top PHP expert anything and have him share information on the PHP world was a great experience. I realized I wouldn't want to start writing PHP code unless I had a need for it because it is messy but if I wanted to get a prototypical site up and running PHP is the choice today because it is good enough and there is a tremendous ecosystem for extending PHP apps. To really compete with PHP on this front, Web Platform Installer, Orchard, and a .Net hosting story that allows deployment from the hoster will be crucial.

 Joe Cartano | Visual Web Developer