Check out some vintage Facebook source code

Perl code reportedly used on the site in 2005 appears on GitHub

facebook_perl_code-600x450_2.jpgImage credit: GitHub/Phil Freo
Did Mark Zuckerberg write this code?

I always enjoy watching Antiques Roadshow on PBS, where people across the country present appraisers with old stuff they bought, inherited or found lying around their attic. Someday, I expect, someone will show up with some vintage source code that may actually turn out to be worth something. Recently, something like that turned up on GitHub: a snippet of code purportedly from the early days of Facebook.

Phil Freo posted Perl code that he says the site spit out in 2005. He believes it was used to generate a graph to visualize your network of Facebook Friends and writes that Facebook gave him permission to post it. You can see full code sample at the end of this post.

As you can see, the code establishes a connection to a database named “facebook” with a username of “mark”. That doesn’t prove it’s real, obviously, but it’s at least fun to picture Mark Zuckerberg coding this up. Who knows? Maybe this is the real deal.

For most of its history, Facebook’s front end has actually been generated by PHP, not Perl. Back in 2007, a hacker got ahold of and released some Facebook PHP code which is also up on GitHub, if you’d like to take a look-see at (and critique) that code.

These days, Facebook’s front end PHP code gets automatically translated into C++ via an internally developed code transformer called HipHop. The resulting C++ code gets compiled using g++. 

Anyway, other than poking fun at the quality of the Perl code, there’s not much significance to this vintage code snippet. Although, if real, and if Mark Zuckerberg had a hand in writing it, it does have a certain historical significance. Plus, as we learned earlier this year, the Zuck has reportedly been coding again, so maybe there will be more recent Zuck-generated code to tear down someday.

Let’s hope!

Read more of Phil Johnson's #Tech blog and follow the latest IT news at ITworld. Follow Phil on Twitter at @itwphiljohnson. For the latest IT news, analysis and how-tos, follow ITworld on Twitter and Facebook.

ITWorld DealPost: The best in tech deals and discounts.
Shop Tech Products at Amazon