Hacker News new | past | comments | ask | show | jobs | submit login
Reddit goes open source - the actual announcement from reddit. (reddit.com)
168 points by icey on June 18, 2008 | hide | past | favorite | 66 comments



I'm a US-based journalist with a team of young, hungry, underemployed aggressive reporters at my disposal. Starting a new metro newspaper makes zero sense today, but launching a voting site for a city and then backing it up with a cadre of investigative reporters who would dig deeper into the stories that made the front page is something I've dreamed of getting off the ground for a while.

I was hoping Reddit's open code would give me the vehicle, but it's now clear that's not the case unless I get a hacker on my team. Any takers?

Pligg sucks. Drupal will work but it's kind of a pain. I'd been anxiously awaiting this announcement because I hoped the Reddit code would give us something to work with.

However when I visit code.reddit.com, all I see is stuff I don't understand. I'm no hacker, but I've developed Drupal and WP sites. However I don't know the foggiest about Python, Subversion or any of the other things listed under the dependencies. This is very disappointing. How do they expect their code to be deployed when it requires a hacker to set it up?

If anyone on here is interested in getting involved in what I believe would be a groundbreaking journalism effort, shoot me an e-mail at methodista@lawnparty.net

Note: I have no funding at all. Simply a concept and the means to launch a handful of trained journalists at news stories that merit more attention and follow-up. With all the talk of "citizen journalism", surely this could be an interesting way to tackle metro news, no?


> How do they expect their code to be deployed when it requires a hacker to set it up?

I think their plan to remind people in hacker communities who are bored with Ron Paul stories that they still exist, rather than create competitors. Though that might be a straw man.

Also, if you want to manage programers, it would be worth your while to read the Mythical Man Month. Right in the first chapter, it explains why it is harder to produce software that runs on other people's hardware (software as a product) than it is to make it run on your hardware (in-house software). That certainly applies here.


If I were you, I'd start by creating a new sub-reddit for your city: http://www.reddit.com/reddits/create

Couple that with a Wordpress or MovableType blog for your own content, and you can at least get people working in the right direction.


I've thought about that. However, I think branding and having a sense of identity is very important, in fact, as this isn't a tech play, but a content and community play, I think it'd be crucial, so being on reddit.com or wordpress.com to me seems like we'd be shooting ourselves in the foot from the get-go. I'd have to have to hack a Pligg install, but that's about what it's come to at this point


Then use slinkset.com, customise it to your own tastes and with your own domain. That's what I did with news.ezlearnz.com.


What's the procedure like for "taking over" the domain. Cost? I don't see that info on their site.

Update: Nevermind. Found it. I'll look into it.


If you've already used Drupal why don't you take a look at Drigg. I haven't used it yet but it looks pretty good to me. If you aren't a hacker I think that will be the only way to achieve what you want while still having the flexibility for your site to do other things.


Have definitely looked at Drigg. It shows a lot of promise, especially if they can get multi-level taxonomy going. The patch is in the works but hasn't been committed yet.


This is a great move. But it only makes sense after a community with momentum is in full swing. The community experience is the driving force behind reddit/digg/HN/mixx/slashdot/etc successes, not the technology.


> The community experience is the driving force behind reddit/digg/HN/mixx/slashdot/etc successes, not the technology.

Slashdot only went open source after they gained a lead with their own instance of the code. Slashdot only went open source after increasing demand from its community. Since going open source, Slashdot has subsequently gained bug fixes and a much more scalable implementation at reduced cost. However, I cannot name any other instances or derivatives of the code which are active - not even Squishdot Zope clones.

So, if you've got a big archive of posts and a large number of active users then open sourcing your code only entrenches your position by reducing costs.


>However, I cannot name any other instances or derivatives of the code which are active

In Spain we have http://barrapunto.com much smaller but also using slashcode. IIRC there are also two more instances, one of them in Portugal.

Barrapunto added its own features for a long time, but they weren't incorporated to main branch, and after serious scalability and trolling problems arose, they reverted to regular slashcode.


> after serious scalability and trolling problems arose, they reverted to regular slashcode.

That's very pertinent because reddit haven't released code to reduce spam:

From the article: There are a few portions of the code that we're keeping to ourselves, mostly related to anti-cheating/spam protection.

Anyone deploying their own instance of the reddit code will have to develop their own protection against spam, trolling and rigged voting.


I thought security by obscurity was wrong in all cases :(


open sourcing your code only entrenches your position by reducing costs.

A valuable observation, but seemingly only valid for frameworks and backends that are merely a glorified CMS.


> a glorified CMS

Much of the web is a glorified CMS, indexed by Google.

If your businesses produces value through human generated content[1], you should share your code to push down the cost of technology, undermining the market for people trying to sell similar but potentially innovative software to your competitors.

[1] as opposed to computer generated content, such as online catalogues or search indices.


hehehe yes...

and a computer is just a collection of coloured pixels flickering a bit.


The community experience is the driving force [...], not the technology.

Absolutely. I'd be much more impressed with a comprehensive API for votes/comments/stories.


Now you can write it...


I doubt they would include such a patch in reddit.com ... it's trivial to write, but their intention is keeping that information inside reddit, which is pretty evil, by Google standards.


Did you just make that up? We give data away all the time.


Links, please? What I'm talking about is an open API like twitter or flickr's, so that people may make 3rd party apps or website that can do anything the website can.

Pretty much, I think it would be best for everyone to let people make reddit (or private reddits) the back-end infrastructure of all sites like news.YC, slashdot (just like flickr is a back-end for other people's sites).

This was submitted as a request well over a year ago:

http://www.reddit.com/info/1jhma/comments/

It's interesting that you commented on that thread, saying:

  adding the display templates is easy. what i'd be really concerned about is the db load, but that's solvable as well.
and also:

  We'd certainly do it. It just takes time, and that's a scarce resource at the moment.
It's been a year and two months since then... how much longer do you need? The data you have comes from the community... why not open automated access to it?


Why not ask them? Even better, maybe they'll see this thread and respond...


They (spez) already did.


Compare the timestamps on my and Spez's comments.


Anyone find any clever ideas, designs, idioms in the code yet?

I'm not interested in starting a reddit clone, but am interested in reading interesting code. The one file I glanced through was readable, straightforward, and concise, the hallmarks of good Python style. That's a very good thing, but I'm wondering if they've done anything especially clever, or implemented anything generally applicable beyond the realm of discussion sites.

Not that they should. Clear, concise, readable, simple code that builds on existing, open code wherever possible is a wonderful recipe for success. But I'm still interested in whether they went beyond that anywhere.


Skimming the code now. Looks clean and DRY, maybe a bit define-happy. Definitely better than I'd have written it.


Don't be so quick to make that judgment regarding your code - they had a lot of opportunities to iterate.


It was writeen in LISP first so a lot of defs make sense if just porting the code.

What's wrong with a lot of defs anyway?


Nothing wrong, it's a matter of taste. To me there are two kinds of code: "worker code" that does actual work, and "managerial code" that passes the buck. Lots of managerial code, deep call stacks, short extracted methods that are used only once etc. are heavy smells to me.

Not saying this is the case with the reddit codebase!


They actually use PostgreSQL's user defined functions, which is kind of cool.


How is that cool? That should be standard with PostgreSQL. User defined functions lend themselves to be used, and are far easier to do in PostgreSQL than other databases. It's shocking that using functions/stored procedures is an anomoly, it should be standard. It is in all our projects.


Usually I avoid using SPs so I can be database independent. If you need to switch database and don't have SPs you don't have to rewrite all that logic. Another reason not to use them is that the DB is difficult to scale. You can avoid using valuable CPU time for SPs on the DB server if those functions can be executed on the application or middle tier layer (that one scales well) as well. But when I don't have scaling problems, or don't plan to change DB I use them as well.


It's cool in the sense that most people don't do it. :) At least, most people who release open source stuff.


Their form validation is nice:

   @validate(over18 = nop('over18'),
	     uh = nop('uh'),
	     dest = nop('dest'))


This is neat. I always thought a hosted reddit/HN solution would be a good startup idea. Imagine a site where I could start my own reddit/HN type space with a unique url. I could then control who comes in (be it co-workers or friends) and have a place where we could all privately share links and start discussions. Great for companies, project groups, families, friends, etc...

I know I won't have time to build this, but I think somebody should.


> a place where we could all privately share links and start discussions.

http://slinkset.com/


Also, corank.com


excellent. So no, don't make what I say.


Friendfeed rooms? Voting on items really isn't necessary for a small group.


How about if you're having a poll to decide where to go for dinner? There's times when it could be necessary.


That seems like an odd thing to do with a link sharing site in the first place. Why not... make a poll?


Weirdly, they've refused to consider moving their source to github (1) citing that they want to "stay in control of their code." So for now their code is stuck with very weak community interaction. Even gitorious would have been a better choice than trac.

It's disappointing and puzzling.

1. http://groups.google.com/group/reddit-dev/browse_thread/thre...


Someone has, however, set up a GitHub mirror of the Reddit code. It's not official, but at least it's there. I understood their position, which could be boiled down to "Seriously, we don't have the time right this minute." As with anything that is new, it _would_ take time to understand what GitHub is, and what it does, if you had never looked into it before.

A lot of people are saying, "Oh, but it's so easy." The Reddit boys' point is that it may be easy, but it still takes greater than 0 time and effort. They either can't or do not want to, dedicate more than zero time and effort at this time. Their prerogative.


mileszs, what's more disappointing is that they did it the wrong way from the start. I fully understand the decision to wait awhile if you've got an established project and you want to slowly move it over. But the reddit guys didn't, and it's pretty clear they did basically no git homework before proceeding with this.

That would be bad enough on its own, but then they handled the response really poorly. This "we don't have time" response was the sane cap on the mouth of a bottle of crazy agitated mailing list messages from a different maintainer saying strange things. It's pretty likely they never even considered it before someone mentioned it.


Line 298 in r2/r2/config/middleware.py:

#god this shit is disorganized and confusing


Or, if you just want the code:

http://code.reddit.com/


I'd be more interested to see the old Lisp implementation.


big boost to the pylons community.

good pylons code to learn from, written by smart dudes, working at a large scale.

hats off to reddit!


might want to read the code before saying its "good" pylons code.


Really curious what the algorithm looks like that moves stories up-and-down the page.

Anyone taken the time to unravel the great mystery behind it?


Woot! found the answer on a reddit thread. Copied and pasted from a commenter:

  def hot(ups, downs, date):
  s = score(ups, downs)
  order = log(max(abs(s), 1), 10)
  sign = 1 if s > 0 else -1 if s < 0 else 0
  seconds = epoch_seconds(date) - 1134028003
  return round(order + sign * seconds / 45000, 7)
"score" is just (upvotes - downvotes). This is then log normalised.

"seconds" is the number of seconds that have elapsed since around 1.46am on 8th Dec 2005.

"sign" just ensures a positive value.

45000 seconds is 12.5 hours. I don't understand.... that looks like hotness increases the older the story is. I know brackets aren't needed but they help readability!"


There's a PGSQL "hot" function as well: http://code.reddit.com/browser/sql/functions.sql


seconds is a number that grows as time progresses, meaning newer stories will always have a higher seconds score than older ones. The sign is included so that the time component hurts, not helps stories that are rated negative. The consequence of which is that newer negative stories are less hot than older negative stories. Also, the gap between positive 1 and negative 1 on reddit is HUGE hotness-wise.


pretty cool

wonder how long it will take for the flood of clones. i can see it now:

"now that they're open source, i can build that reddit clone for elite tech and startup news that i've always wanted to build"


I think there will be an initial flood of clones, but only maybe 3 or 4 semi-successful ones. Remember how everyone said there would be a billion Slashdots when Slashcode was open sourced?


I concur. Several years ago I wrote a "clone" of MetaFilter (which was quite popular at the time) called FreeFilter. A bunch of *Filter sites sprung up with only a few actually "sticking." I don't believe any continue to exist now though.


Yes, but reddit looks a lot cleaner than slashcode.


I actually see this as a good thing for once. The internet needs more content/quality aggregators that are user-driven, not SEO/link-farm tainted. And niche markets are probably the best way to achieve that.

I actually hope this will be disruptive, and popular sites return to servicing their audience directly instead of relying on Digg, for example. Digg has become so popular that it almost needs it's own nested-digg now, a rather ironic self-defeating problem with social popularity and vertical growth. I mean, don't get me wrong... I suspect Digg will continue forward and be hugely successful.

Hats off to the reddit team.


I imagine getting critical mass is the hardest problem.


And the impending jump of the shark thereafter.


>There are a few portions of the code that we're keeping to ourselves, mostly related to anti-cheating/spam protection.

I can understand why they want to keep these hidden but on the other hand these would be some of the juiciest bits. Oh well. I hope one day people can come up with an algorithms that doesn't rely on 'security by obscurity' to deal with spam/cheating - I know I've tried.


Perhaps pg releasing the source to Hacker News was a trial run for Reddit? Or the Reddit guys were inspired by it?


Look at this link <a href="http://www.kolbrenerusa.com/blog/index.php/2007/12/04/50-top..."> 50 Top Niche Social Media Sites, and Their Power Accounts </a>

there are plenty of niche clones


Thanks, guys. Really nice job.


such simple site ... so many technologies it uses. this can happen only to python :)


Will twitter follow suit?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: