Facebook PHP Source Code from August 2007
91–99 of 99 posts
Re: Facebook PHP Source Code from August 2007
#92Amazing that they initially wrote this code and now to join FB you need to answer questions based on backtracking and dynamic programming. :) I wonder if they could do the questions themselves back then.
Dynamic programming questions are explicitly not used in current Facebook interviews. From time to time, Facebook and other companies study the effectiveness of their hiring process by comparing employee performance and interview performance. I believe dynamic programming questions were removed because there was not a strong link between success in this question and future performance.
Re: Facebook PHP Source Code from August 2007
#93Earlier quoted context omitted.
I didn't read it carefully and I don't know much PHP, but is the code really that bad? There's all kinds of worse code out there running everything. As long as it's relatively well organized, you can worry about refactoring as you scale up.
It is 12 years old - these were just before the first versions that had any kind of serious OO capability, however most apps were already built in the "Imperative" style that this is. The hate for PHP on that gist is strong - admittedly back in the early noughties it wasn't fantastic but it was the shortest route to getting a functional website put up. PHP was simple and had a very low barrier to entry. Latest versio…
PHP5 is the release where most of the OO improvements happened (but even PHP 4.3 had a bunch) and PHP 5.0 was released 3+ years before this code snippet leaked.
I wrote a heavily OO based version of Yahoo! Address Book using PHP 5.1 in 2005-2006, so it was definitely doable and fairly common to do so by that time.
Re: Facebook PHP Source Code from August 2007
#94Amazing that they initially wrote this code and now to join FB you need to answer questions based on backtracking and dynamic programming. :) I wonder if they could do the questions themselves back then.
I didn't read it carefully and I don't know much PHP, but is the code really that bad? There's all kinds of worse code out there running everything. As long as it's relatively well organized, you can worry about refactoring as you scale up.
It uses global variables all over the place and includes other files and variables can start stepping over the others. PHP had class support since 2004 (code seems to be from 2007) and they just write function names in global space with bad naming like "redirect" where you can't tell which part of the system it's from.
The whole code is written top to bottom without breaking them up into functions for clarity. You can't even tell which variable is for local use and which is meant to carry some state further down the lines.
Comments are joke too when you read words like "holy shit", "cool stuff", "FIXME?" and "retarded", you can guess the programmer isn't really a focused person and comments read like a personal note instead of trying to give clues to others.
A good code is a code that you feel like maintaining on first sight and this apparently is far from it.
Re: Facebook PHP Source Code from August 2007
#95Earlier quoted context omitted.
I didn't read it carefully and I don't know much PHP, but is the code really that bad? There's all kinds of worse code out there running everything. As long as it's relatively well organized, you can worry about refactoring as you scale up.
This code is a joke. It uses global variables all over the place and includes other files and variables can start stepping over the others. PHP had class support since 2004 (code seems to be from 2007) and they just write function names in global space with bad naming like "redirect" where you can't tell which part of the system it's from. The whole code is written top to bottom without breaking them up into function…
Re: Facebook PHP Source Code from August 2007
#96One way to look at this is to say "Hah, how shameful." The other way to look at this is to say "Hah, clearly business success isn't a function of code quality"
Re: Facebook PHP Source Code from August 2007
#97Earlier quoted context omitted.
What is counterintuitive about this? That best dynamic programmers are the absolute best programmers? I mean come on man..
Seems like pretty clearly GP isn't familiar with the definition of dynamic programming in this context: https://en.wikipedia.org/wiki/Dynamic_programming
Re: Facebook PHP Source Code from August 2007
#98Earlier quoted context omitted.
This code is a joke. It uses global variables all over the place and includes other files and variables can start stepping over the others. PHP had class support since 2004 (code seems to be from 2007) and they just write function names in global space with bad naming like "redirect" where you can't tell which part of the system it's from. The whole code is written top to bottom without breaking them up into function…
Well ... this 'joke' code created a multi billion dollar business and sowed the seed for a platform that is shaping our world in ways unimaginable (in more harmful ways than good, but that is beside the point) ... you can't complain!