It seems overly critical, but still funny (the Haskell one is probably the most spot on)
And after all, Facebook uses PHP and MySql
It seems overly critical, but still funny (the Haskell one is probably the most spot on)
And after all, Facebook uses PHP and MySql
It's like giving a pencil to Picasso and suddenly implying anything he draws will be shit just because he's not using paint. Utterly ridiculous arguments by the pseudo intellectuals here trying to convince themselves how smart they are for using Haskell. Meanwhile, real software developers just get on with writing good clean code in whatever language they want.
And Haskell: https://code.facebook.com/posts/302060973291128/open-sourcin...
This is the common rebuttal of PHP jokes - but pointing to a sole outlier is rarely a solid defense. Especially when they have created Hack[1] and HHVM[2]. So it's not entirely accurate to say they "use PHP."
[1] https://en.wikipedia.org/wiki/Hack_(programming_language)
But they grew on PHP. Those tools came to be after "a lot of time"
And of course they're not the only site that uses PHP (see all the Wordpress installations, etc)
So yeah,they basically use PHP.
HHVM is a different implementation,while Hack is a superset.
Now why,with the tons of money they have,they chosed to stick with it,I dont know. But it's 100% accurate to say they have some PHP code powering their website. But I bet they have as much java code deployed,and next to none haskell.
That's like saying applications written in C++ are "basically C" or Groovy is "basically Java."
And even so, there are obviously plenty of sites, and even startups, using PHP, but facebook seems to be the goto for PHP advocacy in sort of the same way that a certain ranty blog post is for its detractors, neither of which really requires much effort to employ, or counter.
Or you can look at it another way: Facebook regretted their decision and PHP potentially made the switch to a different platform so hard that they were forced to improve the language, rather than leave.
Don't forget that companies need to be able to justify the cost of moving from one platform to another. When you're employing people whose skillset is potentially limited, that's not always possible.
The amount of effort needed to rewrite Facebook is insane. To rebuild the entire site, migrate the data, ensure everything is seamless to the users, fire all the now-useless employees and replace the workforce (with all its own re-training costs)...
A company like Google can gradually phase out languages they use in favour of others because they can prototype things in new languages in other products they own (Think Dart and Go). A one-website shop just does not have that option.
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.
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.
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.
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_...
[2] http://www.tiobe.com/index.php/content/paperinfo/tpci/index....
[3] https://gooroo.io/GoorooTHINK/Article/16191/Which-language-w...
[4] http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
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.
But I find it surprising you're defending PHP if you feel popularity of a language is determined primarily by how well designed it is, as by that logic C and Java are way better than PHP.[2]
[1] https://news.ycombinator.com/item?id=8803088
[2] http://www.tiobe.com/index.php/content/paperinfo/tpci/index....