The Rumpus: On your servers, do you save everything ever entered into Facebook at any time, whether or not it’s been deleted, untagged, and so forth?
Facebook Employee: That is essentially correct at this moment. The only reason we’re changing that is for performance reasons. When you make any sort of interaction on Facebook — upload a photo, click on somebody’s profile, update your status, change your profile information ...See Other Conversations About the Internet: 1, 2, 3, 4.
Our site is coded, I’d say, 90% in PHP. All the front end — everything you see — is generated via a language called PHP. He is creating HPHP, Hyper-PHP, which means he’s literally rewriting the entire language.Jesus Christ. There's yet another reason to hate Facebook.
The original site was written in PHP by Mark Zuckerberg.posted by smackfu at 6:15 PM on January 13, 2010 [1 favorite]
Today, only the front-end that you see is in PHP. Most of the technical heavy lifting is done by servers written in C++, with a few exceptions like Java (mobile), Python (some obscure thing), and Erlang (chat).
PHP is actually reviled at Facebook by most of the engineers, who regard it as an unsafe and inconsistent piece of crap language, but we are stuck with a large portion of our front-end system written in it. We have extremely strict coding standards about how you are allowed to write PHP and which features you are may use (several unsafe or ambiguously-behaving language features are virtually prohibited). There are multiple internal projects aimed at improving or upgrading PHP in various ways; you may see some of them released or announced publicly in the future.
Rumpus: Facebook was probably a big trendsetter in that regard, right?Hey, we give you lots of confusing options! That should make up for the total disregard we have for your actual privacy.
Employee: In my opinion, we’ve always provided the most nitty-gritty user privacy settings from the beginning. There’s no other site out there that’s this customizable.
Can someone with a CS degree please stop by and point out all the things wrong with that?Well, I'm not a PHP expert. but I do have a CS degree. I don't know if you can't reference things at the "top" that are defined at the "bottom" like C, it wouldn't surprise me though, since PHP is pretty old. But in general there's no reason why a scripting language couldn't do look ahead. So the only thing wrong is that scripting languages in general can't do lookahead, but he's correct with respect to PHP.
(PHP is indeed compiled into HTML on the server side; that's not the difference between compiled and not-compiled code at all; PHP is not "scripted" in the sense JS is, even JS has the concept of functions, etc etc etc)That makes almost no sense at all. You don't "Compile" a program into HTML, you compile a program into a machine-code executable that produces HTML. The HTML is the output of the program. It wouldn't surprise me if PHP is compiled behind the scenes these days, but is definitely a scripting language, just like Javascript. It's stored in plain text and is (as far as the programmer is concerned) interpreted every time you request a page. It's a script that generates HTML and then that HTML gets sent to the browser. Javascript is a scripting language that's usually used on the client side, after the page gets to the browser.
Employee: Well, the weirdest one I’ve ever seen was one I was able to investigate, one of the situations which required me to log into other accounts. This guy had emailed my friend at school a very very odd message, pertaining to the name ‘Caitlin,’ which is her name, and ‘poop.’ It was literally one of the creepiest things I’ve ever seen: a two-page message about the name ‘Caitlin’ and its semantic relation to ‘poop.’ We found out that he had actually sent it to the first two hundred Caitlins he found on Facebook search.Okay odd synchronicity. I googled "Caitlin" and 'poop' to see if anything came up. Like if this weirdo had posted his theory online or whatever. (If the interview is real, the names are probably changed anyway.) I came up with this which actually ties back into programming (which we're all talking about for some reason)
Rumpus: That’s weird.
Functions need not be defined before they are referenced, except when a function is conditionally defined as shown in the two examples below.Variables:
It is not necessary to initialize variables in PHP however it is a very good practice. Uninitialized variables have a default value of their type depending on the context in which they are used - booleans default to FALSE, integers and floats default to zero, strings (e.g. used in echo()) are set as an empty string and arrays become to an empty array.
…
Relying on the default value of an uninitialized variable is problematic in the case of including one file into another which uses the same variable name. It is also a major security risk with register_globals turned on. E_NOTICE level error is issued in case of working with uninitialized variables, however not in the case of appending elements to the uninitialized array. isset() language construct can be used to detect if a variable has been already initialized.
« Older Gordon is an open-source Flash runtime -- in JavaS... | Who says anarcho-primitivists ... Newer »
This thread has been archived and is closed to new comments
That universal-password thing sounds a little far-fetched, but I'm no expert.
posted by box at 5:03 PM on January 13, 2010