I think there is a valuable lesson to be learned from this piece of spaghetti. I can't quite formulate it from the top of my head. But it's something like: if you wanna be rich, don't waste your time being pedant - your users couldn't care less.
Facebook PHP Source Code from August 2007
71–80 of 154 posts
Re: Facebook PHP Source Code from August 2007
#72Re: Facebook PHP Source Code from August 2007
#73How did someone "expose the PHP source code"? Did they actually find a way to make the code show up client-side, or was it just someone who managed to get access to the backend stuff? The way it's worded makes it sound like the former, but that seems unlikely...
It's one of the things that make one-off .php scripts easy to deploy (just chuck it into the webroot). With a little effort, this can be mostly prevented: let the webroot .php file just do an ' include("../outside-webroot/actual-script.php"); '
Re: Facebook PHP Source Code from August 2007
#74I remeber these days. I worked at this time for studiVZ - a german social network (still exist, but nobody is using it anymore) and this leaked was caused by a misconfiguration in their Apache setup. In 2008 studiVZ was sued by Facebook. They said we theft their PHP, CSS/JS "code". ( http://techcrunch.com/2008/07/18/facebook-sues-german-social... ). Indeed, the first version of studiVZ was inspired by Facebook. Our f…
I didnt really like it, they basically did nothing in terms of innovation that FB did, it had the same features for years. Later they had a half-assed app platform that never really took off. It was just a blatant rip-off like so many german startups, sadly.
Re: Facebook PHP Source Code from August 2007
#75Earlier quoted context omitted.
It's probably still there and has probably never caused any problems. In other words I think iand is exaggerating.
It is certainly not still there given that facebook doesn't run PHP any more. They wrote a compiler to translate a subset of PHP to C++, which they then compiled into a massive executable. The compiler is open source and called hiphop, and it does not implement the PHP memory limits.
Re: Facebook PHP Source Code from August 2007
#76Earlier quoted context omitted.
This piece of code is doing something very simple and sequential in nature: putting together the (then) Facebook front page. I'm not sure I agree it's spaghetti. Are there any complex relationships that become hard to follow because of an inadequate level of abstraction? It doesn't look that way to me. Many programming methodologies are proposed these days, but the entire "field" smells of pseudo-science. Unless stud…
You make a fair point and I guess everything is relative. My post was not meant to trash the code, but rather to point out that this code shows us that the primary objective shouldn't necessarily be writing the perfect code.
That's a dangerous argument. I mean, if startups stopped pursuing the most elegant code, they wouldn't need, nor would they be able to hire, the "best" developers. And then what?
1. Lots of startups would be able to get off the ground and grow with less cash because they wouldn't have to pay six figures to every developer on staff.
2. It would be a lot easier to find acceptable candidates (no more "you have five minutes to implement sort on a whiteboard...to prove that you can build a web form" challenges during interviews).
3. There would be a lot less premature optimization and use of the framework or NoSQL database du jour.
4. Egos would be hurt as engineers with the most impressive educational backgrounds and deepest technical expertise would be forced to come to grips with the fact that, while they are valuable and have a big role to play at some companies, people with less formal training and knowledge can build working, commercially-viable CRUD applications.
This would be the end of the Silicon Valley startup world as it exists today, I tell you!
Re: Facebook PHP Source Code from August 2007
#77I think there is a valuable lesson to be learned from this piece of spaghetti. I can't quite formulate it from the top of my head. But it's something like: if you wanna be rich, don't waste your time being pedant - your users couldn't care less.
This piece of code is doing something very simple and sequential in nature: putting together the (then) Facebook front page. I'm not sure I agree it's spaghetti. Are there any complex relationships that become hard to follow because of an inadequate level of abstraction? It doesn't look that way to me. Many programming methodologies are proposed these days, but the entire "field" smells of pseudo-science. Unless stud…
* Reaction A: code is ugly, what a bunch of jerks!
* Reaction B strikes me a bit as hero worship. Since we already know the outcomes, already some consider them geniuses; we must conclude every decision they made was a good one, and there is no room for criticism.
Perhaps neither are great, but I think reaction B especially is a little dangerous. One must acknowledge that there are more factors to your success than coding style, but that doesn't mean if you start neglecting it then it will also lead to your success.
Re: Facebook PHP Source Code from August 2007
#78Earlier quoted context omitted.
I wonder if it was based on the code Zuckerberg used for the Java friend graph he had on his homepage prior to Facebook. Could you perhaps censor the credentials and release it?
I am not a lawyer, but even with censored credentials this seems like a bad idea. Especially since my profile is not exactly anonymous. Any Facebook employees want to get me a green light? :)
Re: Facebook PHP Source Code from August 2007
#79When I see code like this, I'm always amazed that I can actually read it and (kinda) understand what it's doing. I always expect code like Facebook's to be so finely tuned and advanced that it'd be completely uninteligable to those outside the company and not an expert in the language.
Re: Facebook PHP Source Code from August 2007
#80I remeber these days. I worked at this time for studiVZ - a german social network (still exist, but nobody is using it anymore) and this leaked was caused by a misconfiguration in their Apache setup. In 2008 studiVZ was sued by Facebook. They said we theft their PHP, CSS/JS "code". ( http://techcrunch.com/2008/07/18/facebook-sues-german-social... ). Indeed, the first version of studiVZ was inspired by Facebook. Our f…
Cool, i remember these days as well. Indeed it very much looked like StudiVZ just used FBs css filed and changed some colors.. It was a typical german clone success story. Dariani did a lot of questionable things but sold in the right time before the downfall of VZ. I didnt really like it, they basically did nothing in terms of innovation that FB did, it had the same features for years. Later they had a half-assed ap…
Some numbers from 2010:
- 60.000 req/s (without static content)
- 2.5 mio. memcache ops/s
- 300k queries to the database tier
We've built that platform with a team of around 20-30 engineers and we had to solve the scaling stuff first - before we could add new features to the platform.
Today it's easy to store 3 billion files (photos). You could easily use S3, but 2007 these services didn't exist or most of the cloud services just started with their services.