6

In every comparison between these two languages, ASP is recommended for "serious" web projects, so why does Facebook use PHP? PHP can't hold persistent database connections and in case of Facebook, I think this would slow down the application. Or am I wrong?

For example: Speed of code execution: ASP.NET-MVC versus PHP

I found that they use PHP because Mark Zuckerberg developed the first version of Facebook in PHP and a change would cost to much afford and money. But assumed Facebook started today, would it be intelligent to use ASP.NET instead of PHP?

Community
  • 1
  • 1
DevTec
  • 307
  • 3
  • 14
  • 1
    Why ASP.NET? Why not RoR, Java, Python, Erlang, C++ or whatever else? Your question invites pure speculation. (And Facebook has enough resources to build their own PHP compiler and VM. They're not exactly your typical PHP user.) – Mat Feb 07 '15 at 10:11
  • Mat, your right, RoR would also be an great alternative to PHP. I'll edit the Question. – DevTec Feb 07 '15 at 10:15
  • 2
    For what it's worth, the Stack Overflow community tends to discourage language wars, since they are rarely useful. Speed is only one factor when choosing a language - large organisations need to consider how expensive hiring is for a specific skillset, what works with their current stack, what the security implications are of a language, whether a language works with their development culture, etc. So, "Facebook use PHP because it works for them", maybe? – halfer Feb 07 '15 at 10:18
  • 2
    This answer may be useful for you: http://programmers.stackexchange.com/questions/55091/why-did-facebook-use-c-beside-php – Tjoene Feb 07 '15 at 10:24
  • 1
    But assumed Facebook started today, would it be intelligent to use ASP.NET instead of PHP? Still this question is unanswered.. – Sometimes Code Sep 27 '16 at 10:07
  • 1. In every comparison between these two languages, ASP is recommended for "serious" web projects A: PHP is built for web! You can definetelly use PHP for "serious" web projects. 2. PHP can't hold persistent database connections A: Of course it can. Where did you get that from? 3. Or am I wrong? A: Yes. You are wrong. – Vinicius Dias Apr 26 '20 at 02:44
  • Why is this question opinion-based? There has to be specific reasons why PHP was chosen by Facebook devs right? – aks Nov 21 '21 at 14:27

2 Answers2

8

Because the original version of Facebook was an open source project.

Facebook project was one of Mark Zuckerberg's university assignments, and he had to do it with an open source project.

Except asp.net, other web programming languages are hard to learn or not fast enough.

If you compare PHP with other web programming languages (as I said except asp.net) it's more reasonable.

And as you said if he want to switch to Asp.net it have a lot of cost for Facebook.

salar
  • 710
  • 3
  • 6
  • 22
  • @halfer as you say Facebook organisation do open source thing , but what you mean about their main product isn't proprietary code? – salar Feb 07 '15 at 10:24
  • No , as i said First of facebook project was completly open source, and as you say we cant say that it fully open source now , but if you refer to question he said that why facebook is PHP ? – salar Feb 07 '15 at 10:29
  • Based on your comment, I've added a clarification to your answer. – halfer Feb 07 '15 at 10:33
  • @Halfer Thank you very much , you make my answer more clarification – salar Feb 07 '15 at 10:35
4

As far as I know, The creators of facebook knew PHP and not ASP.NET, but I could be wrong here.

Goudgeld1
  • 342
  • 2
  • 12