Today's Question:  What are you most afraid of as a programmer?        GIVE A SHOUT

Technical Article => Web =>  PHP

Why hasn't Facebook migrated away from PHP?

  Yishan Wong      2012-02-24 05:14:23      2,969    0

The reason Facebook hasn't migrated away from PHP is because it has incumbent inertia (it's what's there) and Facebook's engineers have managed to work around many of its flaws through a combination of patches at all levels of the stack and excellent internal discipline via code convention and style - the worst attributes of the language are avoided and coding style is rigidly enforced through a fairly tight culture of code review (failing to adhere to the style and "going cowboy" by writing sloppy code results in pitiless mockery by one's peers).  Engineering management has never had to take a strong hand here; this arose largely due to key internal technical leaders just sort of corralling everyone else along.

There is also a lot of industry precedent indicating that re-writing an entire codebase in another language is usually one of the worst things you can do, so at all levels there is a reluctance to do that.  The preferred strategy is to write new components in a de-coupled manner using a better language of choice (C++, python, Erlang, Java, etc); this is easily facilitated by Facebook's early development of thrift, an efficient multi-language RPC framework.  This also helps avoid the worst effects of PHP: it can be totally avoided in subcomponents where the language is grossly-unsuitable.  The broad effect is that the overall codebase slowly evolves away from depending as heavily on PHP, with the components that are still in PHP being written in tightly-controlled, disciplined ways by veteran members of the staff.




Share on Facebook  Share on Twitter  Share on Google+  Share on Weibo  Share on Reddit  Share on Digg  Share on Tumblr    Delicious



No comment for this article.


Load balancing

By sonic0002