by davidw · 17y ago · 0 comments
If he actually spent time reading about languages and designing his own, he would throw in function namespacing and function naming conventions and a good built-in abstraction for database access (with a strong bias against SQL injections and towards placeholders/variable binding from the day one), PHP would come out an okayish language and not an universal hate target.
There are some other blunders that he could just not make. And I'm not even dreaming about template system that makes sense now.
He didn't! Who the hell could do that if he wasn't going.
The PHP's default templating (stick code into templates) sucks (unusable for anything serious).
PHP's default routing (/foo/bar.php, lookup the file) sucks (you really really want one entry point for your web app.
PHP's default code layout (one PHP file per page) sucks too.
Idiomatic PHP is unusable! So you'd NEED a framework. Maybe homebrewn one. And if you're going for a framework, why not start with Django or Rails?
Every large-scale project in PHP contains an ad-hoc implementation of at least half of Django.
What Lerdorf developed was initially a collection of C macro's and functions to make repetitive tasks for web application development easier. If you were developing web applications at the time, which I can safely assume you were not, since your arguments are restrained to comparisons with dev platforms popularized in the past few years, you would realize why the initial popularity of PHP and how it was developed makes sense. It allowed a lot of developers (read: most) with a C background to easily churn out buzzy web applications.
The Zend engine, was not developed by Lerdorf. It was hackish, simple but extremely fast because of mod_php and a decent vm. Combine that with the C syntax and easy administration and you have the core reasons why PHP blew out to be a raging success. As much as one may or may not like something, you do have to recognize that most things become popular for very good reasons - and bitching about them usually means that you are either a) smarter than the collective intelligence of the rest of the world, or b) ignorant.
Now to your points, they are just wrong. PHP has no concept of routing, that is what a web server does. One PHP file per page is also not true, again you are confusing two different things. There is also no 'default templating', I can pipe to, or make PHP calls from the command line. A programming language doesn't need templating outside of 'include' (which isn't a language thing - its an interpreter thing, but lets not get too deep).
So chill out for a moment and appreciate that what Rasmus achieved with PHP is by most measures a success, has a very important place in the web and web history, and like BASIC, Pascal, etc. before it was an important impetus for a whole new generation of people picking up programming.
And every file still starts with <? And if one of them doesn't, then your web app would fail epically because you were gzipping your output into your output stream (one and only one), and this extra space in one of files ruined your gzip.
To be fair, it's wonderful that complex PHP apps ever work. It's a complete surprise to me, I'd say they run-by-accident.