Earlier quoted context omitted.
The original 4chan code was in Japanese and moot used Babelfish to try figure out what did what. From what I remember, the original Futaba code is just as bad ( http://www.2chan.net/script/ ). It's no secret that 4chan is cobbled together with glue and string, moot has said this several times before.
It's kind of surprising though. I wonder what the results of a 4chan re-write by 4chan users would look like. Or even splitting out some functions for re-writing.
4chan source code leaked (2010)
91–100 of 114 posts
Re: 4chan source code leaked (2010)
#92Yes I hate PHP more than the next guy,
Yes this code is terrible,
But you know what? I can read it, and follow along. And that's actually more to say than other "beautiful" code that was obfuscated behind 3 or 4 levels of unnecessary levels of abstraction or indirection.
Re: 4chan source code leaked (2010)
#93It seems that it's too terrible to be the true code. "if($_COOKIE['4chan_auser']", "extract($_POST); extract($_GET); extract($_COOKIE);"
Re: 4chan source code leaked (2010)
#94Earlier quoted context omitted.
Crazy. I knew PHP was bad, but this is just terrible.
what if I told you PHP does not require you to write ugly code? You can do the same in any other language.
Re: 4chan source code leaked (2010)
#95And yet, despite the horrible code, it's still powering an Alexa Top 500 page without any huge problems I've heard of.
Re: 4chan source code leaked (2010)
#96Earlier quoted context omitted.
What's wrong with the if cookie check? Don't the following conditionals for the mode make sure they still cannot post, which is the point? And the rest of the code is still run so any other security checks are still performed. extract is one of those moronic things though that only exists to create security holes and other bugs.
http://pl1.php.net/extract OMG, it's horrible :D
Re: 4chan source code leaked (2010)
#97Ask HN: Would you rather have a beautiful source code with 1000 pageviews/month or an ugly source code with millions of pageviews/month?
>millions of pageviews/month That is technically correct but does not covey the scale at which 4chan operates. According to http://www.4chan.org/advertise , Page impressions per month: 575,000,000; Unique visitors per month: 25,000,000; Posts per day: 1,000,000; Alexa Traffic Rank: 836 (Global) & 371 (US) Quantcast Rank: 305 (US) Google PageRank: 6 Makes me wonder if WebM will increase or reduce 4chan's total traffic…
Re: 4chan source code leaked (2010)
#98And yet, despite the horrible code, it's still powering an Alexa Top 500 page without any huge problems I've heard of.
Crazy. I knew PHP was bad, but this is just terrible.
Re: 4chan source code leaked (2010)
#99Not much to see here, folks. Someone took an old leak of the source code and commented out a few lines for a giggle. Only moot and the developers know what the site looks like now, but given the significant addition of functionality in the past few years, it's pretty much impossible that that would be the only difference in the source. The original leak, from 2010 at least, possibly older: http://pastebin.com/4JVjS02…
Wouldn't the ideal solution for 4Chan be an external data/processing server that dials in to the hosting server to dump out static files? That way the location of the external server remains, at least partially, a mystery, even after the main box is hacked?
Re: 4chan source code leaked (2010)
#100Earlier quoted context omitted.
Not possible. Other languages have features to prevent this.
I highly doubt you have anything else to add because I'm sure you're just another person jumping on the "hate php" bandwagon - but go on, entertain me. Please elaborate.