Skip to main content

A perfect answer by someone, why FACEBOOK used PHP.


If someone like Mark Zuckerberg were creating Facebook today (2012 as I am writing this answer), sure, no doubt they would consider many other languages, frameworks, platforms, architectures.
It's impossible to say whether they would still choose PHP today if they were starting out. Other social-network companies are starting today, and clearly, some fraction of them are still choosing PHP. They may choose PHP because it does the job they need to do, and they know they can hire developers who know it and can be productive with it.
Facebook has obviously been very successful using PHP (even though at that time PHP 5.0.0 was still beta).  There's a strong argument to be made that writing viable software has little to do with the choice of language.  One can find anecdotes of successful projects or disastrous projects using any language.
According to the history described on the Wikipedia page for Facebook, Zuckerberg wrote the initial code for Facebook in October 2003. 
Consider what other web technologies might be considered, and whether they existed in 2003:
  • Ruby existed, but no Rails yet (1.0 was introduced in July 2004).
  • Java 1.4 with JSF 1.x or Spring 1.0.
  • Perl 5.8, but no Catalyst framework (it was introduced February 2005).
  • Python existed, but no Django framework (it was introduced in July 2005).
  • The term Ajax for web programming was coined in 2005, but the use of asynchronous XML requests was still nonstandard, too early to be used with for broad browser compatibility.
  • C# 1.0 and .NET 1.1 (C# 2.0 was introduced June 2006).
  • JavaScript existed, but no Node.js (it was developed in 2009) and no jQuery (it was introduced August 2006).
  • Amazon EC2 was released in August 2006.
  • Heroku was founded in 2007.
  • Go first appeared publicly in 2009.

The point is that Facebook's choice of PHP was perfectly reasonable for the time it was created.

Comments

Popular posts from this blog

PHP code for finding Longest Repeated Substrings (LRS)

<?php Class LRS{ /** •@param array $texts •Prints longest repeated substrings for each text */ public static function getAllLRS($texts){ $stringArr = array(); foreach($texts as $string){ $stringArr[] = self::LongestRepeatedSubstring($string); } return $stringArr; } public function LongestRepeatedSubstring($string){ if ($string == null) return null; $string_length = strlen($string); $substrings = array(); for ($i=0; $i < $string_length; $i++){ $substrings[$i] = substr($string, $i); } sort($substrings); $result = ""; for ($i = 0; $i < $string_length - 1; $i++){ $lcs = self::LongestCommonString($substrings[$i], $substrings[$i ...

Write a function that checks if a given word stored in a doubly linked list is a palindrome.

<?php class Node { public $value; public $next = null; // next node public $prev = null; // previous node public function __construct($value) { $this->value = $value; } } class Palindrome { /** •@param string $word •@return bool */ public static function isPalindrome($head, $tail){ if ($head == null) return true; while ($head != $tail){ if ($head->value != $tail->value) return false; $head = $head->next; $tail = $tail->prev; } return true; } } $head = new Node(1); $firstNode = new Node(2); $secondNode = new Node(3); $tail = new Node(4); $head->next = $firstNode; $firstNode->prev = $head; $firstNode->next = $secondNode;...

What Make Facebook page load faster ?

Facebook has a “ Lazy Loading ” system they call “ BigPipe ” that helps the pages load fast. Facebook breaks each page down into sections they call “ Pagelets” , and using Javascript only load the most important Pagelets first then load the less important ones shortly afterward. And pipeline them through several execution stages inside web servers and browsers, as the modern microprocessor do to serve the various request in an order to increase the productivity. Big Pipe is totally implemented in PHP and javascript. By loading and rendering the main page structure first with minimal info on it, the page appears to load quicker than having to wait for a complete page to download and then render. To exploit the parallelism between web server and browser, BigPipe first breaks web pages into multiple chunks called pagelets. Just as a  pipelining microprocessor  divides an instruction’s life cycle into multiple stages (such as “instruction fetch”, “instruction decode”, ...