11 ms·
Note that this is a response to: EDIT: refer https://twitter.com/#!/codinghorror/status/189571656522534913 https://twitter.com/#!/codinghorror/status/189571656
by polemic 15y ago
Note that this is a response to:
EDIT: refer https://twitter.com/#!/codinghorror/status/189571656522534913 https://twitter.com/#!/codinghorror/status/18957165652253491... - Jeff's 4 year old response is still valid.
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
Jeff gets it right - the language is poorly designed, but it hasn't stopped PHP powering many of the biggest most important sites on the internet today. Banging on about the language's flaws [again] is not very interesting. What would be fascinating would be an attempt to understand why PHP remains so dominant despite the well-known flaws.
Seriously - http://stackoverflow.com/questions/tagged/php http://stackoverflow.com/questions/tagged/php throws up so many pearls of WTF that you wonder how PHP could possibly be so important. And yet!
Time to stop the PHP bashing. It's like comp.lang.js complaining about the flaws of jQuery (and, indeed, any JS library) and expounding the many and various reasons you should never use a third party library. The reality is: when the keyboard meets the road, stuff has to get done, and these are the tools that seem to work.
- bigiain 15y agoNote that Jeff's blogpost is almost 4 years old. Posting this to HN might have been a response to the veekun.com article, but that's not what it was written for…
- polemic 15y agoThanks, noted.
- cageface 15y agoThis is the wrong way to think about it. Just because people can hop on one leg across the finish line doesn't mean that's a smart way to run a race. Ask yourself this: would the Instagram team have been as successful had they chosen PHP? I think not. Javascript is different because we're stuck with it for historical reasons but there are so many better choices on the back end that there is absolutely no excuse to start new work in PHP. Similar negligence would be considered unprofessional in any other engineering discipline.
- rimantas 15y ago> Instagram team have been as successful had they chosen > PHP? I think not. Can you elaborate, why you think so? PHP worked OK for Facebook and Wikipedia.
- cageface 15y agoThe time you don't waste fighting with the language and coding around its deficiencies is time you can spend improving existing features and adding new ones. If you're trying to run a lean startup with only three backend people like Instagram these effects are very important. Those three engineers could have coded something similar in PHP but I'll guarantee you it wouldn't have been as good. Facebook can afford to throw money at the problem and nobody's really trying to compete with Wikipedia so they can get away with it.
- sanswork 15y agoI've developed large applications in PHP for years. Currently we're using other languages at my current company for a couple of reasons. They could have coded the exact same thing in PHP and I doubt it would have taken them any longer. The language isn't great but I never found myself truly fighting it just displeased with some of the syntax. Facebook started with PHP they weren't always the massive company they are today and managed to displace other entrenched social networks.
- knieveltech 15y agoTime savings? How's downloading the entire feature set for content creation, categorization,user management & authentication, and menuing in 45 seconds stack up to arsing around in a text editor setting up your file structure for a new development project?
- rimantas 15y ago> fighting with the language and coding around its > deficiencies That's still too vague. Sure PHP has it warts, but I don't recall anything I could call "fighting with the language". Yep, stack/needle mess and inconsistency in naming is annoying, but not exactly a huge time waster.
- cheald 15y ago> 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 in the URL and the parameters available in $_GET and the ability to write those parameters back to the page via <?php echo ?>. They're all wrapped up in a handy mod_php binary that runs in Apache, and you probably don't even have to do any extra work to get it to run. It Just Works. This has nothing to do with PHP as a language, but it has everything to do with PHP as a web-oriented product. PHP isn't for systems administration, or generalized scripting, or embedding in your game to serve as its scripting engine. It assumes it's web-facing, and that removes a lot of the friction that otherwise trips people up. What this means is that it's trivial to deploy full-blown applications like Wordpress, phpBB, Joomla, Drupal, and a host of others. They are literally as simple as "unzip this file and go to http://yoursite.com/package http://yoursite.com/package. That's huge! As a Ruby web developer, I'm envious of that. I wish I could give people a zip, say "drop this here and unpack it and you're up and running". PHP is the lowest-user-overhead "make things happen on webpages" language in use right now. This comes with all kinds of downsides which many of us are familiar with here, but PHP's success has nothing to do with the language itself, and everything to do with how easy it is to deploy a full PHP stack itself, and then any PHP application on top of that.
- polemic 15y agoThat'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 platforms like AppEngine, but not so much with self-hosted solutions. Or do such things exist? If so, why are they not more prominent? Another huge bonus for PHP is that a AMP stack is easy to run on Windows, Mac or Nix. The same cannot be said for Rails or Python.