Facebook is not written in PHP


Yea, I know you're thinking "This guy's nuts! Everyone knows Facebook is PHP!" Sit down, shaddup, and I'll explain...

But let me address this first: The claim that "Facebook is written in PHP" is frequently used to rationalize using the world's worst language. This is, of course, idiotic because appeal to authority is a logical fallacy. To put it in simpler terms: Just because Ozzy Osbourne abused the hell out of drugs and alcohol and wound up rich, famous and alive, obviously doesn't mean it's a good approach to imitate. Get the picture? So quit saying stupid shit like "PHP is fine because XXXX uses it". It makes it obvious you're an idiot.

Ok, back to Facebook's usage, or not, of PHP:

Like any remotely sane company, Facebook doesn't use PHP for its core systems. The actual "core stuff" language used varies by company, but at Facebook, they "use C++ heavily on [their] back-end systems"[1]. In fact, they "use C++ at Facebook all over the place".

While Facebook has things that are ostensibly PHP, it's not the real PHP. The real PHP is such a piece of shit, Facebook had to write their own alternate version of it (HipHop's HPHPc, which converted the "PHP" to C++). Then they had to make another, the HPHPi. And then yet another, the HipHop VM. Facebook does not use real PHP, and that's because true PHP is just simply crap unsuitable for them.

Not only that, but the psuedo-PHP that Facebook does use is being quickly overtaken by Facebook's increasing usage of C++: "...two years ago, maybe 90% of [Facebook] programmers wrote PHP and 10% C++. Now there are roughly as many C++ programmers as PHP programmers." Additionally, Facebook has had growing internal interest in D (note that link is over a year old already), and Facebook's HipHop team is one of the sponsors at this year's D conference.

So ultimately, no; contrary to conventional "wisdom", Facebook is not written in PHP.

[1]: See question #4 here.

2 comments for "Facebook is not written in PHP"

  1. (Guest) Fathan
    2013-11-18 03:12

    Is it true?

  2. (Guest) guest
    2013-11-21 12:54

    You might want to call FB and tell them they are not using PHp They seem to be confused http://www.zdnet.com/blog/facebook/why-facebook-hasnt-ditched-php/9536

Leave a comment

Captcha