I asked a Facebook engineer what main programming language they use for development. He specifically said "we use C++ for back-end stuff, and PHP for front-end stuff". This doesn't really make any sense to me. I initially translated this to mean 'server-side' code is C++ and 'client-side' is PHP, but after researching this link: http://tinsology.net/2009/06/client-side-vs-server-side-code/ It seems that PHP is in fact server-side code, and HTML/CSS are client-side. Moreover, C++ is not generally used on a webserver running Apache or IIS. Any ideas what he meant?
C++ can be used for CGI's, but I think you misunderstood. They will probably use PHP for the websites, and C++ for backoffice applications and/or webservices. The website is the 'front-end' of the business, so PHP is back-end or front-end, depending on your point of view. PHP is indeed a server side scripting language, so if you're a web developer and you look at it from a web developer's view, PHP indeed is back-end.
Facebook writes (nearly) all of their code in PHP, but they use a compiler to convert it to C++ code.
This is because there are way more PHP programmers than C++ programmers on this world, but C++ is way faster and more efficient.
PHP for things like user login, keeping track of posts etc. and they use C++ for things like databases and obv. the back end.
C++ isn't really uses - you're right. It's just that C++ is faster and with millions of lines of code a small increase in speed here and there adds up. As it runs faster, it also has a lighter load on the servers, saving money and electricity.
I suggest you look at a program called "HIpHOp" which transforms PHP into C++. It was actually written by Facebook engineers for Facebook itself and I'm sure the released it to the public.