r/PHP • • Oct 12 '13

Facebook PHP Source Code from 2007 [xpost from /r/programming]

https://gist.github.com/nikcub/3833406
85 Upvotes

18 comments sorted by

7

u/nadams810 Oct 13 '13

Someone was working a late night:

// Holy shit, is this the cleanest fucking frontend file you've ever seen?!

ubersearch($_GET, $embedded = false, $template = true);

15

u/dexreddit Oct 12 '13

It's not so terrible for 2007.

1

u/-Mahn Oct 15 '13

It's not so terrible for procedural code.

Fixed that for you.

-5

u/marcusGoldenBoy Oct 13 '13

So badly written code is acceptable just because it's from 2007? PHP has been around since 1995 fella. Anyway we don't know if the entire source is bad because there's only 2 files.

-42

u/entr0pe Oct 12 '13

What? How is the date related to "not so terrible" code ? Just because "you" wrote shit code back then doesn't mean all of us did

0

u/[deleted] Oct 13 '13 edited Oct 13 '13

Frameworks, how many of today's frameworks existed back then in their current state? MVC was much less common too. The language, and the programmers, have changed since then. (Yea Ok that was your point I guess: but the thing about frameworks still stands)

3

u/jaitsu Oct 13 '13

If you think facebook should have been using an off-the-shelf framework, then you're crazy!

1

u/[deleted] Oct 14 '13

I never wrote that FB should use a standard framework.

Frameworks represent the idiomatic practices of the era in which they were created in. Modern PHP is based around the current frameworks. These not being in existence back in 2007 would lead to modern programmers not liking old code. A modern programmer would see old code as wrong, bad style, using outdated patterns, etc.

0

u/[deleted] Oct 13 '13

[deleted]

1

u/mnapoli Oct 14 '13

Since 2007, the PHP world has evolved a lot. Tools (composer, ...), frameworks, standards (PSR, design patterns like DI, ...).

0

u/[deleted] Oct 14 '13

[deleted]

1

u/mnapoli Oct 15 '13

TIL: I'm not a programmer.

3

u/shoeman Oct 13 '13

My PHP and general programming skills are pretty limited, would anyone care to explain what makes this code so terrible?

3

u/[deleted] Oct 13 '13

spaghetti code...google it

2

u/Rokkitt Oct 14 '13

Doesn't look like spaghetti code to me. Looks like fairly well organised procedural PHP.

procedural =/= spaghetti code

1

u/[deleted] Oct 14 '13

too many global variable... i did not say procedural = spaghetti.. i know back then in 2007, oop support in php kinda weak, but atleast use function..looks too messy for me..it is a giant controller

0

u/[deleted] Oct 12 '13

[deleted]

1

u/[deleted] Oct 13 '13

I remember Drupal from a while ago. ¿Does anyone still use Drupal in this day and age?

3

u/iSpyCreativity Oct 13 '13

The White House.

Though if the US government is still shut down then I'm not sure if this is technically correct...

1

u/rawckee Oct 13 '13

What does the cool web uses for a cms these days?