General Question

soundedfury's avatar

Ruby & Rails or Python & Django?

Asked by soundedfury (2536points) January 28th, 2008

Which one would you use to prototype a web app? I’m leaning towards Python & Django, since Rails seems to have some performance bottlenecks. I know Twitter was developed on Rails, but they also said they wouldn’t recommend it. Pownce was developed on Django and they rave about the ease.

Any suggestions? Mostly, I’m doing this to learn but I’d like to make something that could actually be used at my current job.

Observing members: 0 Composing members: 0

15 Answers

sferik's avatar

Fluther is written in Python using Django and the developers love it.

You’ve narrowed your choice down to the best open source web frameworks available, so I doubt you’ll have many regrets either way. Rails has a nice test framework. Django has an automated admin interface. A lot of it comes down to which language you prefer, stylistically.

AreaOne's avatar

I think it highly depends on your specific needs, but I would recommend RoR personally. I am building a Rails app. right now and I find it to be very good for my needs. Both are going to have negatives and positives so you will have to weight out both and decide from there.

cwilbur's avatar

If you want to use it at your current job, consider what the politics are like. It might be easier to get one accepted than the other.

Vincentt's avatar

@sferik – mind if I chime in? I consider the Zend Framework (PHP) an excellent one. When it comes to RAD, Rails and Django may be the best, but with the upcoming 1.5 release ZF is shaping up to be very nice and is developed at a very rapid pace :)

paulc's avatar

If you’re doing this to learn then use both. I’ve only dabbled in Python but I’ve heard great things about Django. I have, however, done quite a few projects in Rails and thoroughly enjoy it. Overall, it shouldn’t really make a huge difference which framework you use because, at the most basic level, frameworks are best at making decisions for you on how to structure your app: a benefit that is language and environment agnostic.

The current state of Rails is much improved from the days when there was a lot of talk about bottlenecks. While Rails is exceedingly accessible to develop with, it takes some patience to get it running in production if you are creating your own environment but it is well worth the time.

We’ve settled on low traffic sites simply using fcgi through Apache to higher traffic sites load-balanced with Pound to Mongel (ruby based http daemon) and lighttpd. Lately we’ve had no performance problems as far as there server configurations go. I should point out that the same thing can be done with Apache and mod_proxy_balancer we just chose to use lighttpd because our server admin is more familiar with it.

Its important to note that any framework can suffer if the programmer does not do a good job. There’s a quite a few ways to significantly improve application performance (memcached is a great example).

andrew's avatar

I think a lot of it comes down to whether a whitespace-based language gives you the creeps or you can’t stand colons sprinkled in your code.

We’ve thoroughly enjoyed Django (it has been our best technology decisions), though I won’t say we haven’t had our share of hangups. That said, we began coding when django was still in relative infancy, and many of the hurdles we tamed are moot now.

Rails is definitely a great framework, and has a ton of support. You get a lot of helpers for free. I would imagine that coding in rails is similar to my experience of coding the entire site in scriptaculous (someday, I plan to blog about this)—everything was smart and gave me shortcuts exactly where I needed them, the code was terse and elegant, but once I needed to operate outside the helpers it was much more work (we ended scrapping scriptaculous because of the bugs in the autocompleter in Safari).

I love python. Ruby still gives me a bad taste in my mouth. Like sferik says and as I mentioned before, much of it is personal preference.

soundedfury's avatar

Thank you all for responses.

@cwilbur – I work for a start-up, so our development team is 4 people. All that matters is the app works and doesn’t kill us in bandwidth or processing bills.

@Vincentt – I already know PHP pretty well, so this is just as much a chance to learn a new language as it is to develop an app. I agree that Zend looks promising, but it’s not quite as mature as Django and Rails (even if they are still in their adolescence).

@paulc – Isn’t Ruby slower than Python? I seem to remember some discussion about the inherent performance differences between the two and the strides that Ruby is making in 2.0 to close the gap.

I’ll probably end up finding a second project and just one on each framework.

cwilbur's avatar

If it’s that small a team, what do the others think? Python’s dependence on semantically meaningful whitespace is a deal-killer for some; Ruby’s performance is a deal-killer for others.

(Ruby has performance issues, but it’s a fully-specified language and so there’s the possibility of competing implementations tuned for different tasks. So the performance issues are not nearly as bad as they had been in the past, and the infrastructure is good for improvement.)

But if there are no personal preference reasons, well, I don’t think there’s a clear objective reason to choose one over the other.

(My own preference for something I had to get up and working /fast/ would be Perl + Catalyst + DBIx::Class, I think, but that’s because I’ve got over 10 years of experience in Perl and not much experience in either of the other two. I have a good idea of where the tricky bits will be with that combination, whereas with new technologies I don’t have that experience, obviously. If speed were not an issue, or learning a new language and framework were part of the point of the exercise, I’d probably flip a coin, and eventually learn enough about both to see which I preferred.)

tobytobsen's avatar

I am currently working in a literature study which compares web application frameworks – so this discussion is quite interesting for me. I just learned cakePHP and really liked it – It followes the same ideas ad ruby. The next framework (and language) I wanna learn is zope and python. What do you guys think about that?

paulc's avatar

@soundedfury, I’ve never ready anything that compared the performance of both but it wouldn’t surprise me – Ruby is a very high-level language and that in-and-of-itself is an immediate performance hit. I know you can get significant speed boosts by extending Ruby with C but I guess that isn’t an option for everyone. If I were you I wouldn’t worry so much about the performance specs: give them both a try and see what you like. There’s no sense making your decision before you’ve actually evaluated the options. Ideally you can familiarize yourself with both languages and frameworks. Nearly all languages have their place and rarely (if ever) do their semantics or stylistic nuances actually impede your ability to get work done. At least they shouldn’t.

phoenyx's avatar

If performance is a concern for you, Merb and Ramaze are two up-and-coming web frameworks written in Ruby and designed to be light-weight and higher performance. That being said, I work for a company that does all of its websites in Ruby on Rails and performance hasn’t been an issue. Twitter has an exceptionally high traffic load, and so it has issues that most sites won’t.

A couple of my Python-using friends rave about Pylons, which may be worth looking in to.

I agree with the general consensus here. It comes down to programming preferences and styles. Ruby and Python are both enjoyable languages and have great corresponding web frameworks.

segdeha's avatar

@tobytobsen, Stay away from Zope! I worked on Zope sites for 11 months and it was so, so terribly painful. It’s way over-engineered and has been eclipsed by more modern frameworks (e.g., Django, Pylons, Turbogears, etc.).

I do love Python, though. Honestly, the white space thing sounds like a bigger deal than it is. The nice thing about it is that everyone produces relatively consistent looking code, making it much easier to dive into and understand each others’ work. All you and the other 3 developers have to do is agree on tabs versus 4 spaces!

Vincentt's avatar

@tobytobsen – try asking a new question :)

@segdeha – now that you mention it, I’m going to ask a question on why on earth people want to use spaces ;-)

Edit: Tada!

deathfrombelow's avatar

It depends on your production platform, if Rails is deployed properly, then it performs on par if not better than Django. Not to mention that Django was really designed for CMS like applications, not really anything else, so if you are doing some sort of novel and original project, it will probably be better to us Rails, or if you want to stick with Python, try pylons, which is a Pythonized version of Rails basically.

segdeha's avatar

@deathfrombelow, Would you please provide any evidence (like, a citation) that shows Rails performing “on par if not better than Django”? I’m skeptical. memcached is memcached, no matter the platform, so I’m curious how you might get Rails faster than Django.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther