3 ms·
>This is the common rebuttal of PHP jokes - but pointing to a sole outlier is rarely a solid defense. Sole outlier? Hardly. Half of the web is powered by PHP,
by coldtea 12y ago
>This is the common rebuttal of PHP jokes - but pointing to a sole outlier is rarely a solid defense.
Sole outlier? Hardly. Half of the web is powered by PHP, including tons of websites with huge traffic and usage.
>Especially when they have created Hack[1] and HHVM[2]. So it's not entirely accurate to say they "use PHP."
Hack and HHVM do not show some inherent PHP issue that something like Ruby or Python would not have.
Hack is mostly an attempt to add type checking/hinting to PHP. The lack of type checking would be the same if they used Python or Ruby or Node+JS or whatever.
And HHVM is an attempt at a speedup, to work at Facebook like economies of scale. Considering that plain PHP is on par speedwise with Ruby and Python, that's again not something that would be saved using those other languages. Which is why Google tried to do Unladded Swallow (for Python), Dropbox does their own thing, RoR companies invest hard on speeding up Ruby/Rails, etc.
TL;DR: Hack and HHVM may be proofs of some lack in PHP for Facebook uses, but are not proofs of PHP lacking things compared to other similar languages like Python and Ruby.
- yawboakye 12y ago> Half of the web is powered by PHP, including tons of websites with huge traffic and usage. What powers the web: web servers or web sites/applications? If it's web servers then your claim that half of the web is powered by PHP is false because I'm—and I'm going to be honest here—yet to see/use a web server written in PHP.
- cstrahan 12y agoI don't think that's a fair interpretation of what was meant by that quote. I think the point was that PHP has been used to great effect, regardless of what shortcoming it may have.
- coldtea 12y agoObviously web sites/applications. Web servers would just server static sets of pages without some means to run dynamic code.
- yawboakye 12y ago> Web servers would just server static sets of pages without some means to run dynamic code. Web applications respond to requests. That's all they do. Web servers parse those requests and deliver responses appropriately. You're reducing the role of all intermediaries (DNS servers, caches, etc) and unfairly praising the web application. The web server serves both non-changing static files and the generated documents.
- frostmatthew 12y ago> Sole outlier? Hardly. Half of the web is powered by PHP, including tons of websites with huge traffic and usage. Quality > quantity (just because a language is widely used doesn't mean it's well designed), a huge amount of this quantity are WordPress blogs, MediaWiki sites, or relatively low traffic e-commerce sites. It is not the dominant language of "tons of websites with huge traffic and usage."[1] [Facebook and Wikipedia are the notable outliers...so I'll admit I shouldn't have said sole outlier]. The "quantity" argument is also weakened by the fact that websites are not the only things programming languages are used for, and in terms of overall popularity it's use is a fraction of that of C or Java.[2] PHP also has far less job openings than Java or C# and only slightly more than Python[3] (I imagine Python will eclipse PHP fairly soon). If you're interested in why so many developers consider PHP a poorly designed language I'd suggest reading PHP: a fractal of bad design[4] [1] https://en.wikipedia.org/wiki/Programming_languages_used_in_most_popular_websites https://en.wikipedia.org/wiki/Programming_languages_used_in_... [2] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index.... [3] https://gooroo.io/GoorooTHINK/Article/16191/Which-language-wins-in-terms-of-salarydemand-July-2014/14105#.VJ7jEAAID https://gooroo.io/GoorooTHINK/Article/16191/Which-language-w... [4] http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- wwweston 12y ago> Quality > quantity (just because a language is widely used doesn't mean it's well designed) I'm friendly to the argument that there are often better things than the popular things (and specifically things than notable advantages over PHP for developing software), but not to any pretense that PHP isn't "well-designed." As far as I can tell, it's well-designed as a tool for moving in small conceptual steps from static web documents to dynamic documents to (nowadays, for those who want it) well-organized apps on easily available commodity hosting. There's little that competes with it here in terms of the deployment story and ease of the first part of the learning curve. Moreover, despite the collection of warts and WTFs, it offers more or less the same commonly-used abstractions in its celebrated scripting siblings. Yes, yes, I know, there's all these differences -- you miss the syntax or Tennent correspondent blocks or monkeypatching or whatever is important to you. Rock on with that. Just don't be surprised when choosing PHP over Ruby or Python doesn't seem to turn out to make a difference between success and failure of a product/project. > I'd suggest reading PHP: a fractal of bad design[4] Like most good hit pieces, there's some truth, but it suffers from the focus illusion among other things.