On PHP Future Direction

"The vision has been the same for years. A general purpose scripting language with a focus on web development."
-- Rasmus, creator of PHP Language
To begin with, PHP was never really a general purpose scripting language but a templating language. Or precisely, a web development Domain-specific language (DSL). Do you know, compare to other popular scripting languages (Python, Ruby, or Perl), this language needs a configuration file to work. And yet, I have been using PHP for the past 8+ years and it never occurs to me? Ouch ! Furthermore, it only excels as a complementary component of the LAMP-stack.

The recent disagreement in php internal shown that there are two camps in the list, the PHP way (procedural with some OO) and Java-esque (more OO features influenced by JAVA). I belong to the former camp. I feel that most recent implemented features (e.g. namespacing and trait) are cater only for framework developers rather than mere web developer like us.

Rather than trying to implement yet another complex feature like annotation, why not:

a) Support multi-threading in PHP instead of using pcntl_fork

b) Since we already have a good enough model (PDO) and default view (PHP itself), what's lacking right now is a good controller or router in the core. Something like http_route("get", "/hello/%s", ...), inspired by Silex. Hence, making PHP itself a micro-framework. This sure will render most PHP frameworks out there obsolete.

c) Official centralize library repository like Perl's CPAN or Ruby's gems in the core. Yes, I know we have PEAR and now Composer.

Enough rambling for today. For further reading, read the excellent discussion at Hacker News and r/PHP.

No comments:

Post a Comment