Re:Reddit goes open source - the actual announcement from re...
by cousin_it on Wednesday June 18, 2008 @10:49AM
(#220796)
Skimming the code now. Looks clean and DRY, maybe a bit define-happy. Definitely better than I'd have written it.
Re:Reddit goes open source - the actual announcement from re...
by gms on Wednesday June 18, 2008 @10:59AM
(#220802)
Don't be so quick to make that judgment regarding your code - they had a lot of opportunities to iterate.
Re:Reddit goes open source - the actual announcement from re...
by schtog on Wednesday June 18, 2008 @04:00PM
(#221094)
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?
Re:Reddit goes open source - the actual announcement from re...
by cousin_it on Wednesday June 18, 2008 @05:29PM
(#221191)
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!
Re:Reddit goes open source - the actual announcement from re...
by mrkurt on Wednesday June 18, 2008 @10:40AM
(#220788)
They actually use PostgreSQL's user defined functions, which is kind of cool.
Re:Reddit goes open source - the actual announcement from re...
by asnyder on Wednesday June 18, 2008 @01:09PM
(#220899)
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.
Re:Reddit goes open source - the actual announcement from re...
by y0ghur7_xxx on Wednesday June 18, 2008 @01:30PM
(#220918)
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.
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.