

Rewriting Reddit (2005) - redDragon
http://www.aaronsw.com/weblog/rewritingreddit

======
evan_
> My friends over at reddit.com rewrote their site from Lisp to Python in the
> past week. It was pretty much done after one weekend.

It should probably be noted that this is from 2005.

> The Lisp newsgroup, comp.lang.lisp, was upset about the switch that they’re
> currently planning to write a competitor to reddit in Lisp, to show how
> right they are or something.

Here's what became of that: <http://www.cl-user.net/asp/new>

~~~
ben0x539
From that site:
[https://groups.google.com/forum/?fromgroups=#!topic/comp.lan...](https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.lisp/KMdpv4MwI4M)

"The Common Lisp Directory rewritten in Python" ;-)

~~~
irahul
[https://groups.google.com/d/msg/comp.lang.lisp/KMdpv4MwI4M/A...](https://groups.google.com/d/msg/comp.lang.lisp/KMdpv4MwI4M/ANhvu-43-RwJ)

An April fool's joke.

------
superxor
Though the article is new to me I don't understand the context of this
submission.

(Never using web.py and not being fully aware of Django's status in 2005) I
see that overall they seem to have faired well. All you need is a settings.py
file to run a Django app. The templating is slow performance-wise but pretty
expressive.

I love that the Django community as a whole is pretty responsive to criticism.
The 'Why Django Sucks' talk at DjangoCon is an example. My biggest complaint
was the horrible User model (you cannot not have 'username' for a Django app
using the User model). But they've fixed it now. The major complaint against
Django is that it is monolithic, but the devs have worked hard to keep the
system decoupled allowing one to replace most modules. But if you want
something small Django is not the one for you I guess, and there is nothing
wrong in it. One size fits all is never possible to achieve and not a good
solution too.

~~~
raverbashing
Django 1.5 has pluggable user models (at last!)

If you're looking for a nice Python web framework, try Pylons/Pyramid

Pylons is loosely coupled. Not Django.

Django is _not bad_ and it certainly makes it easier for 99% of projects out
there (CMS style). But for the 1% it's a pain.

~~~
TazeTSchnitzel
I'd suggest Flask. Flask is a very lightweight microframework, yet it contains
everything you need to write a web app in Python. If you want to write
everything in one file with Flask, you can. If you need several files, you can
do that. You can use proper views if you want. Or not.

~~~
anthonyb
It doesn't contain everything you need at all - that's why it's called a
microframework.

If you want to use an ORM, or have database backed sessions, or user logins,
you need to write all that yourself. For example:
<http://flask.pocoo.org/docs/patterns/sqlalchemy/>

Depending on what you're doing, that might be a good thing - but I find
writing things which are already included in Django pretty annoying.

~~~
recuter
Depending on the complexity of the project it might take you just as long to
read how a monolithic framework decided to tie everything together (warts and
all, because that will inevitably have historical cruft and technical debt).

The extensions were mentioned; User logins for example are just a "pip install
Flask-Login" and "from flaskext.login import whatever" away. I had reason to
roll my own, ~100 simple lines that were easily plugged.

There are pros and cons, neither is "better", the right tradeoff depends on
what you're making.

~~~
anthonyb
Well, except that the login process for Django has a lot more people looking
at it, and you know that the parts are going to work together pretty well.

For example, Flask-Login ([https://github.com/maxcountryman/flask-
login/blob/master/fla...](https://github.com/maxcountryman/flask-
login/blob/master/flask_login.py)) imports md5 and sha1 - not a very good
sign. How do I make it use something sane? Well, there's Flask-Bcrypt, which
provides bcrypt hashing... except that it makes no mention of Flask-Login or
how to integrate it. Flask-Login also doesn't mention Flask-Bcrypt.

So... you're back to hacking on or digging into Flask-Login to figure out how
it works and making it use Bcrypt or some other hashing algorithm.

Wait - I just realised that Flask-Login doesn't handle _storing_ user data or
models, or checking passwords, just logging them in. So what do I need for
that? Is that Flask-Principal? And just WTH is an IdentityContext, anyway?

    
    
      An IdentityContext is the context of a certain identity
      against a certain Permission. It can be used as a 
      context manager, or a decorator.
    

You see why people use Django now? :) Sometimes you just want the standard
user-logging-in-and-storing-in-the-database without having to write it
yourself.

------
pyxy
Though this is 'old news' I was surprised by knowing who stands behind web.py.

Several years ago I was doing a little cozy web questionary tool and after
trying Django, PHP, Perl, etc I've come to web.py framework. It was pleasure
to work with databases, web templates, etc in web.py environment. I really
enjoyed making the tool and the result code was tiny, clean and easy for
understanding. Though it was a tiny tool I was very proud and next time I used
web.py for a bigger project (proprietary for internal use only) and it was
pleasure again.

Recently I've read three parts of "raw nerve" articles and found them
interesting. But I didn't even pay attention on author's name. Now reading
"Rewriting Reddit" all the pieces has been bringed together and I'm thankful
to Aaron for his web.py and "raw nerve" articles.

------
edanm
This is from 2005.

I'd be very interested in hearing which of the criticisms against Django are
still relevant, and which have been fixed. I've been using Django for a few
years, and love it, but I don't really know what the state of Django was in
2005 and many of the things mentioned seemed, to me, to no longer be present.
Then again, I haven't used web.py, so maybe there is a better way than Django
in some areas I'm not aware of.

~~~
LeonidasXIV
web.py was viewed as a big joke, because it was quite crude.

Django has merged the magic-removal branch a long time ago, pre 1.0 and since
the newforms branch (also merged aeons ago) it can generate forms and
validation. The template language is limited by choice which might or not be a
good thing. Personally I think the idea is good, just the execution is
inferior to Jinja2. If you don't like it, you can replace it, that's what
loosely coupled means. aaronsw things loosely coupled means it is a library.
It is not, it has stayed a framework and that hasn't changed since 2005.

~~~
zalew
> web.py was viewed as a big joke

and a few years later flask started as an april fools joke.

------
jfaucett
when talking about the API he states ": I imagined how things should work and
then I made that happen... So how should things work? The first principle is
that code should be clear and simple. If you want to output some text, you
call web.output. If you want to get form input, you call web.input."

This is beautiful and exactly what programmers need. I can't emphasize enough
the importants of simple intuitive APIs. This, for example, is in my opinion
the #1 reason why jQuery dominates web frontends.

------
VaucGiaps
Please put 2005 in the title.

~~~
redDragon
Oops! no way to edit now :(

------
danso
Heh:

 _Oh, and isn’t reddit’s real problem that they’re busy changing
implementation languages (!) while digg is sorta kicking their butts? I don’t
know which site is doing better financially (does either one even have a biz
model? What might it be, one wonders), but digg seems more polished, has a
more pleasent UI, seems more featureful, and more popular.

Setting aside the Python v. Lisp debate (which is so boring and pointless),
I’d hate to be in what seems to be reddit’s position: serious, robust
competition and remaking fundamental tech decisions.

Eek!_

~~~
diego
That was true back then. Nobody could foresee that Reddit would get acquired,
and Digg would swing for the fences and fail.

Among other things Digg got overly ambitious, and took what turned out to be
too much funding in the subsequent years. In the meantime, Reddit was growing
organically under Conde Nast without the pressure of VCs looking for a return.
Digg was forced to take big risks, and we know how it turned out.

------
saosebastiao
Even as somewhat of a lisp weenie myself, I still think they made the right
decision at the time. If this had taken place in 2012, it would be another
story. Clojure is an awesome web language, and so is Ruby/JRuby. Hell, even
Node.js would be a good fit for reddit.

------
stesch
This Arc language mentioned in the comments should be a big thing right now.

