Seems that I have a radical approach to the need for PHP interfacing as suggested by Lucas Smith (http://pooteeweet.org/blog/2008/) then a rebuttal by Herman Radtke (http://www.hermanradtke.com/blog/please-do-not-interface-the-php-world/) and finally Lucas Smith again (http://pooteeweet.org/blog/2014)
I think that the approach for PHP should be:
1) Interfaces in the main PHP tree therefore all have to abide or die, that is how Java gets its notoriety. The SPL was a good start, so now let us spread the love to the rest of the core
2) Else start something like Apache Commons for Java which is the Switzerland, and allows drag and drop or reference implementations. However this is also difficult if there are no common interfaces
3) PHP needs that kind of dictatorship that Java has in order to move forward – dictatorships move things forward (whether good or bad).
Why do I say so?
1. What is an interface – it is a contract for behavior, which means that irrespective of the implementation you will expect the same behavior, which enhances encapsulation and abstraction core object oriented design principles. This is critical as PHP needs to grow past its roots and become truly enterprise.
2. PHP has grown successful because it is simple, but with simplicity comes a price which affects how the future looms. While PHP does not need a JCP like community process (3 – 5 years for Standards), it needs to have some form of commitees which advance different parts and aspects of the language which is now larger than the individual core developers. The interfaces mean that there is a reference implementation which is always followed by big vendor implementations – what PHP needs now are stable processes and standards for adding and managing features.
3. So how does this go, you cannot interface the whole language at a Go, however PHP’s object and procedural classes means that we gotta start from somewhere. And please do not go overboard, keep the interfaces simple and clean … I know there are issues like big vendor interests but they will have to sit together and work things out otherwise you will end up with people who will innovate over the language see Java’s Spring Framework (http://www.springsource.org/)
4. Using the HTTP request/response classes I have only used the Zend Framework versions and not the Symfony 2 versions yet (in a few weeks), however I like the object oriented nature of those … but that is just me 🙂
In closing, we have to learn to pick the best parts of other languages in order to improve whatever we use .