Sunday, December 13, 2009

Php technologies' grades

 Last week I was asked by a client:
You used Zend Framework for this small php application. From 1 to 10 [which is the grade framework in Italian secondary schools], how much is this technology sophisticated comparing to the other ones in the php world?
I answered:
8 or 9, I can't think about a more advanced php technology (and with a so much steep learning curve), unless I think about Doctrine 2.
Before Symfony and CodeIgniter developers bite me: given the occasion, I would say quite the same of applications built with your frameworks, since I'm making a comparison with the legacy code I had to deal with in the past.

Stimulated by the question, I decided to rank common technologies and practices I (and many developers) chose (and still choose) for php applications architecture. Note that these ranks describe the complexity and inherent power of the different approaches/technologies, but by no means low ranked solutions should be deprecated: they still get the job done when something more elaborated it's not necessary, and we are not in the mood of killing a fly with the Death Star.
Here is my evaluation:
  • 1: Welcome, today is <?php echo date("Y-m-d"); ?>. 0 is the same but with <? instead of <?php.
  • 2: Html page with embedded php code. Very useful in 1990s and still work sometimes because of its simplicity for temporary and corner-case pages.
  • 3: Set of semi-static php scripts with no code reuse.
  • 4: header.php and footer.php applications; this is the structure of the website my application partners with.
  • 5: header/footer inclusion but with business logic reuse, for instance application that comprehend modules, classes and functions.
  • 6: Procedural open-source frameworks and Cms, for instance Drupal 6. They are becoming not pretty to the eye, but they do the job.
  • 7: Object-oriented applications, that rely for example on in-house frameworks.
  • 8: Zend Framework 1.x applications: object-oriented, more or less testable, little duplication when done right. But the inherent singletons prevent them to rank higher. See you in 2.x...
  • 9: Doctrine 2: Data Mapper for persistent-agnostic domain models.
  • 10: No such technology has been produced in php at the moment, primarily because of the slowly real object-oriented paradigm adoption.
Or do you think there is already a 10 to assign?


AdamB said...

What about FLOW3? IMHO it's 10 in this evaluation.

Avi Block said...

What about CQRS a la Greg Young and Udi Dahan. I think parts of this methodology can be adopted in the PHP world. Though for 99% of applications built in PHP, overkill is an understatement.

evad said...

This is a good one, Giorgio. Turns out my first, own and "serious" projects back in early 2000'ish would get ~5 rank. :)

Giorgio said...

Well, in 2000 it could be different: Php had a fairly ugly object-oriented support (php 5 was released in 2004). We can't just say we ought to have written php object-oriented applications if there were no means to accomplish such a thing. :)

Giorgio said...

About CQRS: I think it does not apply to php applications as it involves command queues and it is a larger architecture. A php application can constitute a part of a CQRS project.

Avi Block said...

CQRS does not necessarily involve command doesn't even require event sourcing. As long as you split you're application into commands and queries, you're fulfilling CQRS. It's a very neat way of splitting up the code, and I think it can be applicable in PHP.

Anonymous said...

Hey Girgio, do you have any opinion about the worthwhileness of the Zend PHP5 Certification or the ZF certification?

Giorgio said...

Its costs are not excessive... If you want your resume or portfolio to stand out it may be worth considering. Personally I prefer to contribute to open source php projects and to this blog to demonstrate my expertise.