Wednesday, November 28, 2007

The Future of PHP

source : Marc's blog

Marc says :

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?

Zend Framework - Power PHP

Zend Interview...

In July, Zend Technologies released version 1.0 of the Zend Framework, an open source application framework for PHP. Here, Huw Collingbourne talks to Mark de Visser, Zend’s Chief Marketing Officer, about Zend Framework, the future of PHP and the challenges of Ruby On Rails, Flex and Silverlight...

So What Is ‘Zend Framework’, Anyhow...?

We asked Mark de Visser to give us an overview of the main features of the Zend Framework and what they offer to developers. This is what he told us...


Zend Framework (ZF) is completely free for development and distribution, that is, is open-source and free to download & use and features the following:
- New BSD license: business-friendly – it’s easy to build your own commercial intellectual property on top of ZF
- An Apache-like Contributor License Agreement (CLA) process assures that the code is free of legal issues – important protection and peace-of-mind
- Fully object-oriented PHP 5 class library, with attention to best design practices
- Tested thoroughly with about 90,000 lines of test code for 140,000 lines of framework code, all contributors were asked to submit test code and documentation with every submission.
- Extreme simplicity, modular “use-at-will” architecture for easy migration and ability to share ZF code with your current applications and even with other frameworks if necessary.
That’s the high-level (above); more specific features and their benefits are here:

- Model/View/Controller architecture – an industry standard best practice for web apps Full database support (incl. MySQL, PostgreSQL, SQLite, Oracle, DB2, & MS SQL Server) – all major databases you may need, with the ease-of-use you expect from a framework
- Internationalization support necessary for most modern web applications – in a global economy providing localized versions in your users’ language is easy and straightforward
- Authentication & sessions – to make managing sign-on & users of your application easy.
- AJAX/JSON support – to help meet the ease-of-use your users now come to expect
- Search – native PHP port of industry-standard Lucence search engine
- Syndication (RSS & Atom supported) – don’t be left behind without the data formats & access your Web 2.0 users need
- Web services – Zend Framework aims to be the premier place to consume and publish web services with support for REST, Http, Google Gdata APIs, Amazon, Flickr, Yahoo!, del.ici.ous, StrikeIron services, and others – create mashups and other web 2.0 apps easily.
- Adobe PDF – support for PDF creation, reading, editing
- Mail – read and send e-mail, including support for MIME Many other framework services including support for safer and more secure applications with input filtering, authentication, & HTML escaping, as well as caching, filtering, logging, input validation, and more.

- Download Zend Framework: http://framework.zend.com/

HC: Let’s start by talking about the Zend Framework. There are already numerous PHP frameworks around - such as CakePHP, PEAR and CodeIgniter. Is the Zend Framework ‘in competition’ with those or can it be use in collaboration with them?

Mark de Visser: We would not say that Zend Framework competes per se, with any other PHP framework. Different frameworks have different aims and there really is no “one size fits all” in that regard.

Due to its modular “use-at-will” architecture, Zend Framework can be used with any/all of these frameworks. As a result, bolting on the Lucene search engine, adding PDF generation/editing, or even re-architecting your app to be a modern model-view-controller web app can all be done to greater or lesser degrees, depending on which other framework you are working with.

HC: What factors would determine which the choice of framework for a potential user?

Mark de Visser: We anticipate that larger enterprise developers will find Zend Framework an excellent choice to start any “green field” (new) project and that some of the factors they might use to choose a framework would be to carefully investigate: licensing (both of the framework itself and of any contributed code), how best practices are embodied in the framework, security support built-in, how thoroughly the code has been tested, how well it has been documented, how easy is it to migrate and whether or not you are ‘stuck’ in a particular way of doing things once migrated, as well as that it contains all the latest features one might want in a framework.

HC: Recently CodeGear launched a ‘visual’ PHP system, Delphi For PHP, which has its own open source class library and a drag-and-drop application designer. Is this the way forward for PHP development?

Mark de Visser: We are not familiar with CodeGear’s approach but subscribe to the idea of enabling framework classes so they can be used in visual designers.

HC: Over the past year or so, Ruby On Rails has emerged as an increasingly influential framework. If I were considering the pros and cons of developing a web application using Ruby On Rails or PHP and the Zend Framework, what things should I consider when coming to a decision?

Mark de Visser: We find that most programmers pick languages based on a number of criteria. We think that Zend Framework will be an important addition that makes PHP more attractive, just as Rails makes Ruby more attractive in others. .

Aside from that, by choosing Ruby on Rails a developer subscribes to a whole approach, including semantics, naming conventions, application architecture, etc. In contrast, Zend Framework lets you use as much or as little of the framework as you wish, making it very easy to adopt it gradually for existing code bases.

PHP is the technology used for many of the most scalable web applications, including Yahoo, Facebook and YouTube. These sites drive the decision for many commercial developers to PHP, and subsequently to Zend Framework.

HC: One of the features of the Ruby language is that it is object oriented from the ground up. With PHP, objects have been ‘bolted onto’ the language, haven’t they? Doesn’t that mean that PHP won’t take advantage of things like, for example, rigorous encapsulation and data hiding? Isn’t that something that goes in Ruby’s favour?

Mark de Visser: A key part of the move from PHP 4 to 5 was to make objects first-class citizens, including rigorous encapsulation and data hiding. So with PHP5 programming in PHP is really no different than programming in any other object oriented languages.

Zend Framework leverages this capability of PHP5 and to create a framework that is fully OO and rigorously encapsulates and hides data. By embodying object-oriented best practices Zend Framework helps a developer learn, and stay safe.

HC: Can you explain what part Zend plays in the development of the PHP language? Do you have full control over the design and implementation? Or is the future of PHP determined by the efforts of the open source community?

Mark de Visser: Zend does not have control over PHP, although some of its employees are active participants in the decisions of the open source community. Zend benefits greatly from the vibrant PHP ecosystem and tries to give back to this community whenever possible. It has many of the developers who work on maintenance and future versions of PHP on its payroll and also supports major open source projects like Zend Framework and the Eclipse PHP Development Tools (PDT).

HC: What is the state of development on PHP 6? What are the significant new features that will be added to the language and will they ‘break’ existing applications?

Mark de Visser: There is an active PHP open-source community at work on PHP 6. i18n with full unicode support for multi-byte characters and most likely namespaces seem to be the major features under consideration for PHP6.

HC: There is a great deal of activity in the realm of so-called ‘Rich Internet Applications’ at the moment - a field currently dominated by Adobe’s Flex but now being challenged by Microsoft’s Silverlight. One of the special features of Silverlight is that it will be programmable using Python, VB, Ruby or JavaScript. Are Flex and Silverlight going to squeeze out PHP? Can PHP find a way of working with them?

Mark de Visser: PHP being a server-side language works just fine with Silverlight & Flex. Flex and PHP work together beautifully. There is an article on the Zend Developer Zone HERE that explains this well - and is written by an Adobe employee. Additionally, Microsoft (one of our partners) has released an Atlas-based Ajax toolkit for PHP (some links you might see are on the main library site that Microsoft supports; also see HERE, HERE and HERE, which further strengthens the usage of PHP and other client-side technologies like Silverlight and Flex/Flash.

Unrelated to those two, but a connector between client & server side is the WebORB project that you can find HERE; they are also interested in building their code into Zend Framework—and they already have a free open-source PHP kit available now.

HC: Finally, PHP has been one of the driving forces of ‘Web 2’. Looking ahead, five or ten years from now, how will the face of the web have changed and what part will PHP play in that?

Mark de Visser: Zend finds predictions of that sort difficult at best. But as Andi Gutmans, Zend CTO for Product Strategy and co-founder has said in a recent ComputerWorld profile of him:

“One trend that I think is going to be critical to the IT industry in the coming years is the decentralization of IT. It is being enabled by a few factors. The first is dynamic languages like PHP, which are making it increasingly easy for lightweight developers to become productive. The second is the rise of service-oriented architecture, which is leading to the end of monolithic application architectures. Third, the shift toward Web applications that are making it extremely easy to deploy applications inside the enterprise, not requiring a central function to test, deploy and manage those applications. This change is going to allow companies to become far more productive and agile, significantly decreasing the traditional backlog of business applications IT has in its queue. It will also enable an increasing number of such applications to leverage the organization’s existing assets by integrating the SOA-enabled infrastructure.”

As a follow-up to Andi’s prognostications we’ll also mention that IBM has built a management dashboard ‘mash-up’ tool of sorts to do just that, that is, leverage an organization’s existing assets—and though it’s just getting released, it’s already a fairly high profile project at IBM gaining them many SOA-enabled customers—and is called QEDWiki (Quickly & Easily Done Wiki) which is built entirely on Zend Framework. You can find out more about this project here: http://services.alphaworks.ibm.com/qedwiki/

You also may want to view this demo here: http://www.alphaworks.ibm.com/demo/flash/display/qedwiki4


Zend Technologies, Inc., the PHP company (http://www.zend.com/), is the leading provider of products and services for developing, deploying and managing business-critical PHP applications. Zend’s founders are the architects of PHP, which is used by more than 22 million Web sites.

Mark de Visser joined Zend in December 2005. Previously he worked for Agitar Software, a supplier of tools for Java software developers. Before Agitar, de Visser was vice president of marketing at Red Hat Inc. where he was a member of the team that created the company’s market-leading position with the introduction of Red Hat Enterprise Linux. He also worked for twelve years at Borland International in international and product marketing roles, and as vice president of corporate marketing.

About Me

Ordinary People that spend much time in the box
Powered By Blogger