Live data from Hacker News

PHP Sucks, But It Doesn't Matter

codinghorror.com

111–112 of 112 posts

Re: PHP Sucks, But It Doesn't Matter

#111
post #81

Earlier quoted context omitted.

The interesting thing to ask should be if Facebook or Wikipedia's engineers would use PHP if they had to start from scratch. I used PHP for a big project before for legacy reasons but I wouldn't choose it for anything new even with a machine gun pointed to my manly parts. Neither would I use Java or VB for that matter.

Pretty sure they would agree. The Quora and Asana founders seized on the opportunity to leave it behind, and what I've heard from Facebook staff is that they've managed to live with PHP. I can't remember anyone saying they like it. http://www.quora.com/Quora-Infrastructure/Why-did-Quora-choo...

Our main takeaway from that experience is that programming language choice is very important and is extremely costly to change.

Taken directly from the horse's mouth, handwavy arguments about languages making no difference to the contrary.

Re: PHP Sucks, But It Doesn't Matter

#112
post #97

Earlier quoted context omitted.

> What would be fascinating would be an attempt to understand why PHP remains so dominant despite the well-known flaws. I've actually put a fair amount of thought into this. I've arrived at the conclusion that it's because it ships with the Big Three parts of any web app in a single package: Request/response handler, scripting engine, and template engine. To the novice, there is no distance between the query string i…

That's a really good analysis. I'm currently mostly using Python, but I've had a lot of PHP experience. Once everything is configured python is a dream, but if I just want to prototype a simple website, it just isn't worth it. Same for the average blog or small scale business site. To me this signifies a significant hole in the market that competing products could fill. We've already seen that, to some degree, with p…

Exactly. To get Python running, you need your webserver, some kind of fcgi/wsgi module or interface running in your webserver, specialized configuration for your app in your webserver, Python installed, some enumeration of your app's packages installed, and finally, your application running.

We laugh at PHP as a giant glob of senseless stdlib crap, but for its purpose as a web-facing product, it works. Users almost never have to worry about installing extra libraries or modules. mod_php means that you never worry about whether or not you have mod_proxy and some fcgi wrapper installed. You don't have to worry about process management.

This doesn't make PHP less of a disaster from a purist's standpoint, but I think it's exactly the things that make it a disaster (gigantic stdlib, no real package manager to speak of, single-threaded, designed to run in short-lived processes and then die off, etc) that make it widely accessible as it is.

I still think there are huge issues with PHP as a language, and I'm long past the point where I'd consider it an ideal candidate for web applications development (because I can deploy python and ruby apps with ease now!), but it has wildly succeeded at hiding all the underlying machinery from the user so that Joe Average can just start scripting his webpages.

Post reply on HN