226 points · by neilk · 14y ago · 61 comments
> In case you have found some PHP logos, icons or other material around the web, feel free to point those out to us, so we can include them here, if appropriate.
So thinking PHP is horrible without ever having ever used it is as bad as thinking PHP is good without ever having used anything better.
The amount of sheer genericity, that is consistent reuse of concepts and freedom of expression stemming from wide application of simple rules, in something like Python is staggering compared to the myriad problems he lists with things like PHP's object model, built-in types, assignment mechanics, etc.
I started out doing web development in PHP in the 90s and then eventually graduated to desktop application work in C++ and finally added Python (on the desktop and also again for the web) to the mix in the last half-decade, and while I realized quickly that these were better languages and that they were much more fun to use due to the features they offer and the way things just click into place, Eevee's post was a fun tour of all the little whys.
Then again, Python 2.x's ordering rules - falling back to alphabetical collation of the type names when objects can't be ordered otherwise - almost smells of PHP-style implicitness :). Good thing that was made more strict in Python 3.
To take your Python example: I recently wrote a small Python application because in that context, Python was the obvious choice. Turns out that instantiating an object of a variable class name is quite non-intuitive (I don't even remember how it was done, it was typically something you need to look up every time you use, much like the syntax of calling a member function through a function pointer in C++ - I looked that up so often that I know by heart now that it's on page 219 of the 2nd edition of the Stroustrup - but I disgress...). Whereas in PHP it's simply $classname = 'AClass'; $a = new $classname(); . Completely obvious and in line with the way everything else works in PHP.
Again this is not to diss Python, I like some of the things of it that it does differently than other languages and there are many people doing great things with it. It may even well be that in the aggregate, Python has less 'annoyances' or rough parts than PHP, I don't know. It's just an example to illustrate that things are never black or white, and IMO the whole 'I hate XYZ' is widely overblown, because really, life is too short to get one's panties in a bunch over a stupid programming language, of all things. Sure I am annoyed with bad tools, but hating them and spending hours and hours crusading against them... That's the ultimate waste of time, im (maybe not even so h) o.
You're not alone. There are many of us. PHP powers the Internet, period. Facebook, Wikipedia, Wordpress, Drupal, etc. etc. You can whine all you want about this and that, but you can't argue with success.
As far as hammers go, I had my wife make me a stuffed PHP elephant! It's on my desk right now.
That's a bit strong; I would even say it borders on being outright false no matter how you meant it. PHP is convenient for bashing out quick server-side scripts, but it doesn't "power the Internet" any more than any other language does.
Facebook, Wikipedia, Wordpress, Drupal, etc. etc. You can whine all you want about this and that, but you can't argue with success.
"Success"? You say it as though the use of PHP were in any way consequential to the success of those projects. Wordpress and Drupal, maybe, but Wikipedia and Facebook are squarely business successes more than anything.
I'm not saying PHP is necessarily as bad as people make it out to be (though I personally think it is), but the fact that a company like Facebook uses PHP (and in fact has poured millions into desperately engineering around its many faults) isn't exactly a shining testament to the virtue of the language (any more than a hypothetical Company X using COBOL internally would make COBOL a better language).
See:
* http://www.quora.com/Would-Facebooks-maintenance-costs-be-lo...
* http://www.quora.com/Quora-Infrastructure/Why-did-Quora-choo...
* http://www.quora.com/Do-Facebook-engineers-enjoy-programming...
Care to discuss the design and architecture of the Mediawiki parser and template system, and what its history and future look like?
There is a difference between the web and the internet. The Internet is powered by computer networking hardware, on the on the other hand, the web is powered by utter crap like HTML, CSS, JavaScript, and of course PHP.
McDonalds sells more meals than French Laundry. I don't think Thomas Keller cares.
PHP certainly has it's niche, and like the "fast food" niche, it can be adequately nutritious and fullfilling for the customers, and hugely profitable for the sellers.
There are _certainly_ other ways to do things though, and without doubt ways of measuring results that are more or less flattering to PHP. I'm not personally any more enamored with "Enterprise Java" as as web development tool, but there's clearly people selling those solutions who've got a _very_ convincing sales pitch.
(But yeah, I can see why PHP specialists might be "over" HN's typical attitude towards PHP…)
C powers the Internet, period. Facebook, Wikipedia, Wordpress, Drupal, etc. etc. You can whine all you want about this and that, but you can't argue with success.
PHP is written in C. So, yeah, I guess that's true.
If you're going to make more, please announce; I'm buying.
>GG: Your take in one line on PHP.
>RL: In one line…it’s a web hammer - the one tool that you can use to solve any web problem you have.
Full interview at http://gg.ieeeiitr.com/rasmus_interview.php
The interview was for the college IEEE magazine.
I have never seen PHP explained quite so succinctly.
(Where's my NailDriverDeviceFactoryModuleImpl?)