My thoughts on his thoughts on PHP

June 16, 2008

by — Posted in Zend Framework

On the Zend Framework mailing list JurriĆ«n Stutterheim asked for thoughts on his blog post PHP… what to say?. I started replying to the list but found I’d written so much that it was better to clutter up my own space than a public one.

“Zend Framework already has a set of conventions. In my opinion it’s a good thing to improve these conventions even further and make them apply not only for Zend Framework, but for PHP as a whole.”

I suspect that Zend Framework will introduce an interesting dilemma for Zend and PHP where by improving more users experience and understanding of so called advanced programming concepts like OOP, design patterns, etc, they will also increase their expectations of the underlying language.

What onus that puts on the development of PHP itself is really the question. It may be a positive one, with PHP developers and those from other frameworks/languages able to move between their framework and Zend Framework more comfortably. The negative may be that Zend Framework is working on a layer above PHP to the extent that it begins to feel like a language within a language (something that Lukas Smith has been referring to in his Kiss my … post) and the nagging question then creeps in as to how much we are duplicating the functionality of a web development focussed language in a web development focussed framework? I’ve already started kicking myself for getting a bit carried away and unnecessarily using Zend Framework components when the same can be achieved with PHP.

An even bigger question that I’m dealing with right now is what to train new programmers in? The argument is almost endless, but the answer is rarely PHP for any other reason than ease of entry. If developers are going to be working at the higher level that Zend Framework has moved development to, then the question is why start new programmers with a programming language that is rarely recommended as being at that level?

Zend Framework is actually a good way to get someone into PHP and also make sure they keep away from so many of the bad habits that have plagued PHP development. But that is partly a case of keeping them away from PHP itself. Wouldn’t they then be better learning a language that is often used to teach programming, like Python, and once they’ve developed good habits introduce them to a framework for development? In other words I would prefer to have someone learn PHP via Zend Framework whereas with Python I’d be content to have someone learn Python and then a framework.

The question I know that only time will answer is what the cross-pollination will be between Zend Framework and PHP. Targetting that at the core developers I’m interested to know what future plans there are for removing and/or adapting Zend Framework features that become native to PHP itself and/or become more widely hosted such as 5.3’s namespaces against Zend Framework’s pseudo-namespaces.

Of course I’m not naive enough to think that Zend hasn’t thought about any of this, but then I’m not looking at it from that high up. From my perspective the disciplines that Zend Framework introduce actually open possibilities that are as lateral as they are upwardly PHP. Once you climb the Zend Framework mountain you begin to see it has neighbouring mountains that it has a lot in common with and that’s actually a good thing.