Why does Facebook use PHP as the main webend development language?

Source: Internet
Author: User
Which development language does a website use. In fact, only technical personnel are concerned about the language, but it is also worth mentioning. Which development language does a website use. In fact, only technical personnel are concerned about the language, but it is also worth mentioning. Reply: this is a historical reason. any giant grows up from an early age.
FaceBook's PHP is a binder language and converted to C ++ for execution.

As Facebook engineers have said, class libraries are far more important than languages. 1. PHP is a language dedicated to HTTP Server Side.
2. PHP is well written, and the syntax parser is very simple and efficient.
3. PHP has low overhead. it is not suitable for HTTP, unlike Java, which requires a virtual machine each time.
4. there are a lot of users, and developers can look for Cal Henderson of Flickr to explain: "ages's don't Scale, Architecture Scale"
In fact, there is no reason to choose a language. when mark writes facebook, he is most familiar with php. he can use php to solve all the problems that facebook needs to solve, so he should choose it.
It turns out that php is indeed suitable for webend development.
Of course, more importantly, geek used php to write websites in that era.
As for compiling to c ++ or something, it is the solution that has to be invented only when the performance requirements of fb are getting higher and higher. it has nothing to do with the language to choose.
  1. Easy for engineers
  2. Low learning cost
  3. More flexible
FaceBook's PHP is mainly used in the front-end presentation layer. it should not simply be the main development language. I don't think FB has many choices at first. the language to choose depends on: 1. technical background for beginners 2. quickly and efficiently build a prototype 3. follow-up technical support, for example, it is relatively easy to find PHP developers. Of course, it is not that easy for FB to change to a certain scale. it is more about compromise and compromise. Previously, FB used HipHop to convert PHP code into C ++ code before it was executed on the server. on the basis of the original website, it increased the traffic processing by 500% to 600%, however, this is far from enough. later, they no longer converted PHP code into C ++ code, but directly converted it into native computer code (the language that the server chip reads ), in addition, PHP code is directly converted when executed. By tracking the website's real-time code execution, they can use a better way to convert PHP code into native computer code, and ultimately improve the processing speed of the website. this is a historical issue. Facebook was an internal website written by Zuckerberg in college for a few days. it certainly did not take into account the simultaneous use of billions of people.

Facebook has suffered from the problem of using PHP as the core language for development. The PHP architecture problem cannot be solved by the Framework. However, it is impossible for such a large system and a large number of employees to completely migrate to another language. Therefore, after Facebook's HipHop pre-compilation efforts, he began to work on the HipHop JIT parser. How does HHVM improve PHP performance? Historical reasons! For historical reasons, they regret it. Now I am using python. because of the open source, LAMP is now the most popular gold combination, because php is easy to use, but the easier it is to use, the more memory consumption, such as php, js is far from running native C/C ++ fast. Facebook's php architecture has been divided into multiple layers, and they have spent a lot of effort in converting php into C for operational efficiency.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.