Ewww, You Use PHP?
blog.mailchimp.com
blog.mailchimp.com
[1] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de... [2] http://thedailywtf.com/Articles/We-Use-BobX.aspx
Here's a few discussions on just how wrong [1] and clueless he really is [2].
[1] https://news.ycombinator.com/item?id=4177516 [2] http://forums.devshed.com/php-development-5/php-is-a-fractal...
PHP is not all procedural spaghetti code, it does have modern frameworks, some of which are quite nice. And despite it's flaws (yep... someone posted Veekun's thing, everybody take a shot) there are reasons for choosing it, such as low overhead for deployment, and ubiquitous availability.
Low overhead for deployment and ubiquitous availability are definite advantages for the beginning of a project. Unfortunately, those two advantages disappear when your site becomes successful. For a large user base, there's more overhead involved in keeping a PHP webapp running smoothly, and by that time you won't need ubiquitous availability because you'll be, hopefully, running and configuring your own servers.
I think it's largely bad rep due to the ease of misuse and dodgy frameworks.
Also, it seems like the obligatory "if you replicated their special and custom 'platform' in C and it exceeded Ruby or Python's performance by miles what would their reasoning for continuing to use Ruby or Python be?" People like the language, deal with it...
- How knowledgeable your current employees are with it (and willingness to adapt and switch, as well as how long it will take to be as productive after the switch)
- Time taken redo all your servers to support it and pay someone to do it
- Subtle bugs that may appear related to the platform switch and not being as knowledgeable about it at first.
- As someone else mentioned, they may actually like PHP. That may seem hard to understand for some, but heck, there are even people like that like Java. We might not fall under either case, but for the same reasons people like other things that people may find inferior (certain car brands, TVs, PCs components, etc), people apply the same logic to programming languages.
Economists call this phenomenon "Path Dependency" and it's all around us.
http://en.wikipedia.org/wiki/Path_dependency
And the costs are not just high because of the labour. There's also a high degree of risk. In practice we know less about the running code than we think we do. It usually contains enormous amounts of knowledge about edge cases that will, most likely, be missed on the rewrite and cause trouble.
I'm assuming that they don't have to worry about any of that and are given three platforms (PHP/Ruby/Python) that, for the sake of my argument, all do the same thing. Then we ask the question, which would they choose and why?
If you look at the larger companies that do switch platforms, the ones that generally make the leap usually do so without replacing the entire stack (Java to jRuby or Java to Scala, etc). Not always the case (since the language can still be hurdle itself), but the cost to switch in those sort of cases is far lower than jumping off the jvm/clr/etc.
I'm sure if you asked Facebook now (and got an honest answer) that they would totally agree they would have picked another language and platform than PHP to build on given what they have had to go through since. However, PHP is what the developers knew starting out and sometimes it's better to go with what you know than learning something entirely new as building something from scratch is already a huge undertaking that can wear you down. Adding the burden of learning a new language/platform at the same time can lead to taking on too much and slow progress/motivation as well as lead to procrastination or distraction. It might lead to regrets later, but the greater regret is not building at all than choosing the right platform.