Live data from Hacker News

Rails and Django comparison whitepaper

vaporbase.com

1–10 of 15 posts

Re: Rails and Django comparison whitepaper

#5
Overall I feel that the paper is good and accurate...

There is one thing that annoyed me though (having used both Python and Ruby extensively):

"Ruby and Python are really quite similar. For example, Both are strong object-oriented languages."

That is NOT True. OO was probably not part of Python's design from the start. It feels really tacked on when you have to call 'self' everywhere, and try doing inheritance past a parent (to grandparents and so on...); that's when it becomes really obvious that OO was an afterthought in Python, though this may change with Python 3000 (haven't seen it yet)

For the record I still feel that Python is a good language (for my C friends), it's just not for me - or for most people i know that like OO

Re: Rails and Django comparison whitepaper

#7
post #6

Haven't read the whole thing over, but they make no mention of performance comparisons in the conclusion. How could you miss that!

Haven't you heard? Performance doesn't matter; it's all about scalability these days. After all, what's the difference between 100 servers and 200 servers?

Re: Rails and Django comparison whitepaper

#8
post #7
post #6

Haven't read the whole thing over, but they make no mention of performance comparisons in the conclusion. How could you miss that!

Haven't you heard? Performance doesn't matter; it's all about scalability these days. After all, what's the difference between 100 servers and 200 servers?

Let me get this straight. So you would choose the framework with slightly better plugin support and larger community even if it meant it was three times slower and consumed twice as much memory? If you have deep pockets and have no adversion to unnecessarily managing huge server farms, then go ahead.

I've presided over two rails websites in the past and topping out at around 15req/s on average was not fun. Rewriting to Django and getting 45req/s and less memory usage was definitely worth it. (I'd rate my development experience in other areas to be about equal)

Re: Rails and Django comparison whitepaper

#10

Overall I feel that the paper is good and accurate... There is one thing that annoyed me though (having used both Python and Ruby extensively): "Ruby and Python are really quite similar. For example, Both are strong object-oriented languages." That is NOT True. OO was probably not part of Python's design from the start. It feels really tacked on when you have to call 'self' everywhere, and try doing inheritance past…

The article is correct. In this interview (http://twit.tv/floss11) Guido states that Python has been OO from the outset (1990).

The thing you have to understand is Ruby and Python do OO differently. To Python everything is a hash table. This isn't the case for Ruby and their differences mainly stem from that. It adds interesting elements like functions are very simple to pass around in Python because they are not bound to a class. It is still OO, just a different way of doing it.

Guido has also repeated for years that passing around self isn't a technical necessity. He prefers it as part of Python's "explicit is better than implicit policy. What you have to understand is that a method call boils down to method(receiver, args...). Python just makes that explicit.

Another quote from Guido:

"Get rid of self: I think this has been addressed in the responses; it's not as easy as you'd think, and there are important advantages to the uniform interpretation of methods as "just functions that get called in a funky way". In Ruby, everything is a method, or an anonymous block, and there are no "free functions". Python uses the complimentary approach, treating functions as first-class citizens. Both approaches are complete; they are however incompatible, and you can't easily morph one into the other. (Personally, I find that the criticm of explicit self has about as much merit as the criticism of Python's use of whitespace.)" (http://www.artima.com/weblogs/viewpost.jsp?thread=214325)

I too think it is kind of a silly argument. Passing around self has never been a problem for me. 4 more letters for each method. Not a problem, imo, in exchange for first-class functions. And super() in Python works fairly similar to super in Ruby AFAIK.

For the record, Common Lisp users probably find both Python and Ruby's OO limited and clunky. Just got to keep in mind there's different ways of approaching it.

Post reply on HN