Live data from Hacker News

4chan source code leaked (2010)

pastebin.com

71–80 of 114 posts

Re: 4chan source code leaked (2010)

#71
post #62
post #35

Earlier quoted context omitted.

that's just not true. Given my experience, most PHP devs dont use a framework or even composer. When the forefront of your language is wordpress, it doesnt help spread best practices.Agreed you can write crap in every languages,you can write jsp pages, but it's unlikely you'll get a java job if you dont know OO or Spring.

Come on now, I hate PHP more than anyone else, but seriously, wordpress is the best that PHP has to offer. It doesnt suck. It has a quite nice API - its the plugins around wordpress that have quality similar to this 4chan source code. Ive also seen much worse in Java world, with JSPs and all kinds of taglibs and action-handlers mashed up to create a soup which would make you crave for PHP.

+100

People here love to poke fun at WordPress. I'd love to take any of them out of startup-land and make them work for a full week in a 10 years old corporate piece of software, written pretty much in any language.

Re: 4chan source code leaked (2010)

#72
post #50
post #11

Earlier quoted context omitted.

No serious, modern PHP developer writes code like this. If it were a code sample for any respectable PHP job, it would be a massive "do not hire" flag.

Confirmation bias. 99% of PHP developers out there are in fact absolute shit, and they're happy with it because they're developing "websites" instead of "applications." Right tool for the right job. You can use qualifiers like "serious" and "modern" but you're deluding yourself if you think they mean anything when the pool of PHP developers is so staggeringly high.

I'm under no delusion. Admittedly this is the wrong place to be debating anything PHP, but I wouldn't suggest that the average skill level of "everybody who writes PHP" is anything better than incompetent. The people I'm sitting next to now and have worked with in the past are as real as I am - the 1% you recognise are the serious and modern PHP developers. We exist and we're the pool you hire from.

Of course, right tool for the right job. PHP has specific use cases but that's another discussion entirely.

Re: 4chan source code leaked (2010)

#73
post #47
post #23

F* me. No wonder PHP has a bad rap..

I think the fact that you can drive a multi million user website that was once valued at $1.2b (by a VC admittedly) on 2600 lines of pretty bad PHP code when most of the users are exactly the sort of people who'd try to hack it is actually a testament to how good PHP is. Redeveloping the site in Go, Dart, Python or Node, or whatever language you like best, wouldn't increase 4Chan's value in any discernible way. At th…

I wouldn't say it's "pretty bad PHP code" if it did what it needed to, and as you say, it was rather resistant to attack.

Re: 4chan source code leaked (2010)

#74
post #59

Earlier quoted context omitted.

Crazy. I knew PHP was bad, but this is just terrible.

I know hating on PHP is en vogue but you could probably write the same ugly code with another language too.

Yes you could, but it's harder. extract($_GET) does not look as bad as eval(request.GET) but it's almost the same thing for example.

Re: 4chan source code leaked (2010)

#75
post #61

Earlier quoted context omitted.

Why? 4chan is not a high target. There is no reason to over engineer it. Mostly it will be prepubescent teenagers throwing a fit and bombarding the server with bandwidth. The hack of earlier today was due to an obsession over a female 4chan moderator. That should say enough.

CloudFlare was hacked with the sole intention of taking over 4chan.org's domain. They're a huge target.

Okay lets say they are a massive target. There is still a monetary issues.

4chan is a cultural and ideological landmark on the American internet. Not only are their clones, but "Cloning 4chan" is almost a business in and of itself. And they fail. 4chan's month to month profits are barely to not-at-all existent. In a purely dollars and cents way, 4chan is a failure.

So their is very little monetary motivation for discovering the secrets of the 4chan's operation.

Security is a trade off of Financial Risk vs Financial Investment. There is no Financial Risk in 4chan being hacked. They have no user accounts, they have no financial data. They have no overly complex-secret-sauce-search algorithm.

The only thing to 'steal' is a collection of Japanese/American Pop cultural referential gif, jpg, and webm files.

Re: 4chan source code leaked (2010)

#76

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…

Noted. I have added "(2010)" to the title.

A diff that compares the old leaked source to the "new" one: http://pastebin.com/KkeLzb6q.

Re: 4chan source code leaked (2010)

#77
post #59

Earlier quoted context omitted.

Crazy. I knew PHP was bad, but this is just terrible.

I know hating on PHP is en vogue but you could probably write the same ugly code with another language too.

Not possible. Other languages have features to prevent this.

Re: 4chan source code leaked (2010)

#78
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?

Ability to pay my bills

If the beautiful code with 1000 pageviews/month does that, good

If the ugly code does that, good as well. It may be harder to maintain (depending on the circumstances, some "beautiful" code is dreadful as well) which means less money in the bank

Code is usually beautiful until it meets reality with all the exceptions, corner cases, input sanitation, etc

Re: 4chan source code leaked (2010)

#79
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.

Why would bad code hold them back? The technical debt of quick and dirty code lets you get things out faster now at the cost of development time later on (and uptime if you're very slapdash).

I don't blame people for buying into the TDD and other perfectionist bandwagons, until very recently the zeal around the topics meant that you couldn't question the fervent push for very narrow and specific types of software quality. I mean, people were saying "tests are documentation" and I had to nod my head and smile just so I wouldn't get trounced by folks without the development experience to know why that wouldn't work, but had read a blog post saying it does.

Re: 4chan source code leaked (2010)

#80
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.

but it makes it incredibly easy to, which is the reason why people hate it. If I'm a good programmer, of course I'll write good code. If I have to fix someone's shit code, of course I'm going to be incredibly angry if it's only there because the language encourages it.

Of course, if the language makes it very easy to write bad code, even as a good programmer I could easily end up writing stuff that's incomprehensible etc.

Post reply on HN