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

Code for Mail in PHP

PHP mail function and mail configuration in  XAMPP  and sending mail is done from sendmail through localhost. I hope it will help you. mail() function <? php $to = 'dubeynitish22@hotmail.com' ; $subject = 'Test' ; $message = 'Hello' ; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion ();   if (! mail ( $to , $subject , $message , $headers )){ echo "Error !!" ; } else { echo "Email Sent !!" ; } ?> 2. php.ini configuration (For SEND-MAIL) [ mail function ] ; For Win32 only . ; http : //php.net/smtp ; SMTP = localhost ; http : //php.net/smtp-port ; smtp_port = 25   ; For Win32 only . ; http : //php.net/sendmail-from ; sendmail_from = me@example . com   ; For Unix only . You may supply arguments as well ( default : "sendmail -t -i&q

PHP code for finding distinct elements common to all rows of a matrix in O(n) time complexity

<?php class Matrix{ /** •@param 2D array $matrix • •Prints distinct elements common to all rows of the matrix */ public static function getDistinctElementsCommonToAllRows($matrix){ // A hash map to store count of elements $hashmap = array(); $selectedHash = array(); $rows = count($matrix); $cols = count($matrix[0]); for ($i = 0; $i < $rows; $i++) { // Increment the count of first // element of the row if(array_key_exists($matrix[$i][0],$hashmap)){ $hashmap[$matrix[$i][0]] = $i+1; } // Starting from the second element // of the current row for ($j = 1; $j < $cols; $j++) { // If current ele

PHP code for Implementing LRU cache.

<?php interface LRUCache{ /** •@param string $key •@param string $value •@return bool $result • •Stores value against the key in the cache */ public function insertIntoCache($key,$value); /** •@param string $key •@return string $value •Gets the value of a key from the cache */ public function getFromCache($key); /** Purge the entire cache */ public function purgeCache(); /** •@return int $count •Gets the number of successful cache hits so far */ public function allCacheHits(); /** •@return int $count •Gets the number of unsuccessful cache hits so far **/ public function allCacheMissed(); } class Cache implements LRUCache{ // int the max number of elements the cache supports private $capacity; // Array representing a naive hashmap (TODO needs to pass t