Live data from Hacker News

4chan source code leaked (2010)

pastebin.com

91–100 of 114 posts

Re: 4chan source code leaked (2010)

#91
post #87

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.

Well, others have written their own scripts - KusabaX springs to mind. There's another one called TinyIB or something as well.

Re: 4chan source code leaked (2010)

#92
I mean,

Yes 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)

#93
post #3

It seems that it's too terrible to be the true code. "if($_COOKIE['4chan_auser']", "extract($_POST); extract($_GET); extract($_COOKIE);"

Thanks everyone for your insightful comments: now I've learned that the leaked code is actually from a past leak when 4chan was in a more primitive state, but you're right that it is truly ingenious even then.

Re: 4chan source code leaked (2010)

#94
post #66

Earlier 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.

Oh, i'm completely aware of that. I was just really talking about this document, didn't mean to spark the debate.

Re: 4chan source code leaked (2010)

#95
post #30

And yet, despite the horrible code, it's still powering an Alexa Top 500 page without any huge problems I've heard of.

4chan doesn't need good code. Of course it wouldn't hurt, but if the main point of good code is test-ability and organization for complicated projects... Well, 4chan just isn't a very complicated project. The simplicity is a design decision from what I've read moot say.

Re: 4chan source code leaked (2010)

#96
post #63

Earlier 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

Why there isn't a flashing red warning label at the very top of that page, I have no idea. This is one instance where I would actually sanction using the tag.

Re: 4chan source code leaked (2010)

#97
post #67

Ask 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…

I can't imagine WebM impacting 4chan anytime soon, it will probably reduce 4chan's load when(if) WebM takes off but I highly doubt more than a small fraction will choose WebM over a .gif in the immediate future.

Re: 4chan source code leaked (2010)

#98
post #30

And 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.

Sorry to anyone who down voted me. I didn't mean PHP is a bad language. It has done amazing things for the web. I just didn't like the look of the many snippets of HTML in the code which is more common in PHP than in other languages in web development.

Re: 4chan source code leaked (2010)

#99
post #51

Not 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?

There's nothing static about 4Chan. My guess is that the performance issues would be terrifying.

Re: 4chan source code leaked (2010)

#100
post #82
post #77

Earlier 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.

Most languages dont have extract($_POST) and hop,everything's overwritten... PHP has a lot of shit like this.Yeah you dont have to use them,but they shouldnt be here at first place,if PHP core devs cared about a sane API. PHP doesnt have a sane API. PHP core devs dont give a damn. That's why facebook developped Hack and HHVM.
Post reply on HN