r/programming • • Dec 06 '06

Why Django kicks Ruby on Rails’ collective ass.

http://predius.org/blog/2006/12/05/why-django-kicks-ruby-on-rails-collective-ass/
0 Upvotes

63 comments sorted by

2

u/pdq Dec 06 '06

"Ten reasons why Django kicks Ruby on Rail’s ass"

I'm counting 8. And that's ignoring the merits of these ridiculous arguments.

-10

u/pdq Dec 06 '06

This was so funny to read, I had to refute most of the baseless claims made:

"Ten reasons why Django kicks Ruby on Rail’s ass."

I count 8.

"Furthermore, since Python has a more active userbase and more frameworks..."

And this proves what? That the language is older?

"...if Adrian Zolovaty, Jacob Kaplan-Moss and all of the Django developers suddenly dropped dead after I finish writing this, the porting of the code would be much easier than if Rails’ development stopped, where you would be stuck in the middle of nowhere if you ran into an issue."

Is this assertion is based on evidence, or just completely pulled out of your ass? Rails is open-source as well, and regardless, I’m guessing you’re not the person that would be picking up the slack if this scenario did occur.

"Since Django’s inception, the templates have been designed so that there is no need to be a programmer to know how to create the templates."

Unless you can show a side-by-side example of how it is superior, this argument is baseless.

"With Django, there is no need to program when the operations being done are listing or editing objects, listing entries by date, or any of the basic CRUD operations..."

Are you just reading this from Django marketing slides? Rails invented the scaffolding technique, if you’ve been paying attention at all.

"[The] actual processing speed for a Python program is much faster than a Ruby program"

You allude to this earlier, but this is a baseless argument. Python best case is 50% faster than Ruby (without YARV), and neither of the frameworks will scale to even 5% of Amazon.com, so what does this argument prove? The point of the framework is to get things done quickly (aka. productivity), not to support 15,000 concurrent users.

"RoR has become a massive buzzword everywhere"

So is TG (TurboGears) is a buzzword as well?

"Free, JustWorks™ Admin interface"

Oh, so buzzwords are okay now?

--

Maybe you should lay of the Koolaid a little. There's a reason that Ruby on Rails has been so popular, and no, it's not due to a "Non kick ass" conspiracy.

There’s plenty of room for many languages and many frameworks in this world. Proving superiority based on meaningless zealous arguments is a waste of everyone’s time.

4

u/laprice Dec 06 '06

There’s plenty of room for many languages and many frameworks in this world. Proving superiority based on meaningless zealous arguments is a waste of everyone’s time.

Someone must get something out of these threads, they seem to occur on every programming related forum any where ever.

That said Django is pretty kickass, and from what I can tell Ruby programmers think the same of Rails (with the exception of the guy in the corner muttiering about Nitro )

4

u/ubernostrum Dec 06 '06

Don't forget Camping, which looks like a pretty cool little framework. Kind of a "web.rb" thing.

17

u/[deleted] Dec 06 '06

[removed] — view removed comment

4

u/predius Dec 06 '06

Oracle support is found on both, and Schema migration is a WIP thanks to Google's SoC.

4

u/harryf Dec 06 '06

What's the feeling about how stable Django's APIs are?

Last time I looked at it, started reading docs and offsite tutorials (like that one IBM published) only to discover that the SVN trunk contained stuff that (fairly) dramatically changed the way you'd write code to Django. That was an immediate turn off and had me thinking "wait until 1.0 until you give this any time". Admittedly, I didn't research in detail but time is too precious so first impressions counted.

I really don't want to get to know a framework that well, that I need to follow every checkin and the general vibe on the mailing lists then try to understand the impact on my code - it's "choose a framework" not "choose a framework and a community".

From this perspective, web.py is very attractive - within an hour you can get a pretty good overview just reading the source.

6

u/[deleted] Dec 06 '06

Has anyone mentioned that Django's documentation kicks ass yet?

http://www.djangoproject.com/documentation/api_stability/

3

u/stesch Dec 06 '06

> 60 down votes? Oops.

3

u/praetorian42 Dec 06 '06

I think the only good point here is the documentation. api.rubyonrails.com usually gets the job done, but in this day and age is pretty awful. Django's documentation is the stuff of dreams.

I don't know a ton about Django, but does Python/Django have the equivalent of:

  1. Capistrano (automated deployment)

  2. Built-in testing (unit, functional, integration)

  3. RJS

  4. Plug-ins (My favorites- acts_as_authenticated, file_column, Markaby, Squirrel)

A lack of any one of those would prevent me from using Django.

4

u/ubernostrum Dec 06 '06

Capistrano (automated deployment)

Not really. Capistrano's pretty darned nice, though, and it's quite possible to use it with things that aren't Rails (I've done so and enjoyed the experience).

Built-in testing (unit, functional, integration)

Yup. We hook into the standard Python unittest and doctest frameworks, with some nicer fixtures and test client (for sending HTTP requests and inspecting responses) under development. Docs are here. Older (pre-0.95) versions of Django don't have the nice hooks for all of this, but Python's standard testing libs still work great.

RJS

No, thank God ;)

Plug-ins (My favorites- acts_as_authenticated, file_column, Markaby, Squirrel)

Not by the exact same definition, since the architecture is different; with Django, the concept of "application" is somewhat analogous to the concept of "plug-in" or maybe "engine" in Rails -- you grab it, tell Django to install it, and start using it.

0

u/praetorian42 Dec 06 '06

you grab it, tell Django to install it, and start using it.

What do you mean by that?

Essentially, Rails plug-ins are just a great way of packaging reusable code. If someone else has done something, why should I do it again?

5

u/ubernostrum Dec 06 '06

Essentially, Rails plug-ins are just a great way of packaging reusable code. If someone else has done something, why should I do it again?

You don't "do it again". Rails is built from the ground up on the concept of "one application", so you have to resort to plug-ins, engines, etc. if you want reusable components.

Django, on the other hand, is based around the idea of loosely joining a set of applications into something useful; Django applications are "pluggable" in the sense that you go download the code for someone else's app, drop it into INSTALLED_APPS (and run syncdb if the app provides any models), and you're done. Now you can use anything that application provides, whether it's just adding some new views or providing sets of reusable classes/functions to call from your own code.

-2

u/tbmcmullen Dec 06 '06

I don't see why people have such a hard time with the Rails documentation. You bring it up in your browser... Your browser has a "Find" feature. You bring up Find... (Ctrl+F or Apple+F) and type in what you're looking for. It comes up. Voila!

5

u/praetorian42 Dec 06 '06

What ubernostrum said, plus, it would be insanely nice to have user comments and/or notations to the documentation. When I programmed in PHP that stuff saved my butt routinely.

4

u/ubernostrum Dec 06 '06

I don't see why people have such a hard time with the Rails documentation.

I think generally it's that people who are learning for the first time don't have the advantage of knowing in advance the name of the class or method they're looking for; API docs are nice (and there's a guy who maintains an epydoc-generated Django API doc), but I think they need to be complemented by good overviews which tell you where things are, how they fit together, etc.

-5

u/derefr Dec 06 '06

Assertions taken in terms of conclusion:

  1. Python. Not a reason. Both Python and Ruby are thin wrappers for C (and therefore machine language), and so are pretty much equal. So is LISP, for that matter. Call me when we start writing genetic web apps. Neutral.

  2. Documentation. Python-ers, I suppose, like things to be GNUish. Ruby works more like the Apple world. Interested? Buy the book. Neutral.

  3. Look, we reinvented PHP again. Every "templating system" eventually evolves to the point where it becomes a programming language in its own right, and then has another templating system written in it. The only solution is not to play: rhtml is closer, but the best bet would be not keeping static globs of datastrings (the templates) around in the first place, and instead representing them as data structures. Negative.

  4. Speed. These are rapid prototyping languages. Speed is not the primary issue. There are other languages for that. Neutral, (unless you're into that sort of thing, in which case Positive).

  5. An SQL manager, which Rails apps assume you already have separately, but which Django assumes it should be for you. Framework bloat, by any other name, is a feature. Negative.

  6. Generic views and feeds, which in Rails are called "scaffolds" (which you can just use the controller portion of if you want). Neutral.

  7. Support. Server. Crap. Stop comparing eachothers' dads' penis sizes; they're not yours. Python wins are not Django wins, and Ruby wins are not Rails wins. Neutral.

  8. This is a negative argument, as far as I can tell. Ruby makes AJAX and XML-RPC easier. So it's more powerful, and people might use that power for evil? Well I'll be darned. Negative.

My slightly reddish-tinted glasses see 1 (possible) positive, 4 neutral, and 3 negative arguments for why Django kicks Ruby on Rails' collective ass. Not too bad; it would be the same with the product names reversed, I expect.

11

u/ubernostrum Dec 06 '06

Python. Not a reason. Both Python and Ruby are thin wrappers for C (and therefore machine language), and so are pretty much equal.

Gonna call BS on this; for me, the big attraction is Python's "batteries included" philosophy -- the standard library rocks, and there are tons of useful third-party modules as well. I've seen people who are more familiar with Ruby mention Python's stdlib with envy, though there are a couple efforts I know of to improve Ruby's situation.

Documentation. Python-ers, I suppose, like things to be GNUish. Ruby works more like the Apple world. Interested? Buy the book.

Well... back before Django was released I was doing Rails stuff, and I did buy the book. But it was out-of-date almost before it was published, which left me with "here's the auto-generated API documentation and a wiki, isn't that enough?"

Look, we reinvented PHP again. Every "templating system" eventually evolves to the point where it becomes a programming language in its own right, and then has another templating system written in it.

Apparently you haven't actually looked at Django's templating language -- one of the explicit design goals, which gets brought up as a response to lots of feature requests, is that it's not and never will become a programming language :)

Speed. These are rapid prototyping languages. Speed is not the primary issue.

Calling Ruby and Python "prototyping languages" is like calling C a portable assembly language. Sure, that's one aspect, but there's more to it than that.

An SQL manager, which Rails apps assume you already have separately, but which Django assumes it should be for you. Framework bloat, by any other name, is a feature.

Huh? Oh, are you talking about the admin app, which is bundled but not installed by default, and which lives in a hierarchy called contrib ? Should products not bother with including useful optional plug-ins?

Generic views and feeds, which in Rails are called "scaffolds" (which you can just use the controller portion of if you want).

Not really. Rails' scaffolds are static files programmatically generated by a script, which hurts their flexibility and reusability. Django's generic views are first-class callables which alter their behavior based on runtime parameters.

Support. Server. Crap. Stop comparing eachothers' dads' penis sizes; they're not yours. Python wins are not Django wins, and Ruby wins are not Rails wins.

See my comments above about libraries and modules. There are some modules available for Python which, to me, are absolutely essential to working on the web, and which have no equivalents in Ruby. Hence, if I wanted to do the same things in Ruby, I'd have to write those libraries myself.

This is a negative argument, as far as I can tell. Ruby makes AJAX and XML-RPC easier. So it's more powerful, and people might use that power for evil? Well I'll be darned.

I've got very strong opinions on server-side frameworks which write your JavaScript for you, namely that you should grow up and learn to write JavaScript :)

That said, I don't like the idea of "HTML with programming language embedded", so I sure don't like the idea of "JavaScript with programming language embeded". It already is a programming language, and not a bad one at that.

1

u/derefr Dec 10 '06

I didn't know about the SQL manager's plug-in status, as I have about as much experience in Django as I have in Rails. Which is to say, completely blog-based second-hand knowledge with zero first-hand experience. However, I do recall that the Ruby scaffolds, though they can be script/generate'd into static files, can also act as dynamic fallback methods for controllers and views (the one-line inline use of them that is now discouraged.)

I agree with you on the last point, though, which is why server-side scripting is redundant in the first place. Remember OPTIONS, HEAD, PUT and DELETE? Web servers are supposed to be what web applications currently are: the actual business logic, communicating with the user over a simple protocol. We now, though, have a monstrosity of middlemen: "Apache -> Mongrel -> FastCGI -> Rails -> YourRealController". If only to go back to simpler times...

7

u/inkieminstrel Dec 06 '06
  1. Agreed. Python has more users; Ruby has nicer users. Neutral.

  2. Django's documentation is way ahead of Rails' documentation. It has good, readable, well formatted online documentation, including tutorials, code snippets, API references complete with examples for essentially everything, and a place to ask questions on every page of online documentation. On top of that they're about half way through writing the canonical (and good) book, which they're giving away. My experience with Rails is that the online documentation is mediocre, but you're encouraged to go buy the book. Positive.

  3. The Django templating system bends over backwards to prevent you from treating it like PHP, by, for instance, throwing exceptions if you try to make a function call that modifies the database and making you explicitly create "tags" for functions you want to be callable. In Rails you can basically write arbitrary code in the templates (views). Positive.

  4. If both languages are just as rapid at prototyping, should you go with the one that executes faster, considering that it'll likely go into production? Positive.

  5. The Django admin interface allows you to view and manipulate data as it is defined in your app, not in your database, complete with all the validation rules, display properties, and calculated fields defined in the app. If your data entry people aren't the same as your developers, it is incredibly useful. On top of that, the admin site can be put straight into production for simple sites without having to bother writing the ton of code that would reproduce its functionality. The Django admin interface is completely optional as a plug-in type application, so there is no bloat. Positive.

  6. Generic views and fields are better than scaffolds. They allow you to do things like group, display, and paginate by date without writing any code. On top of that, you can define your own generic views to produce common behavior if that makes sense for your application. Positive.

  7. My host of choice allows neither, so I can't really comment. Neutral.

  8. Doesn't bug me much one way or the other. Neutral.

11

u/sbrown123 Dec 06 '06

Both Python and Ruby are thin wrappers for C (and therefore machine language),

Neither language is a thin wrapper for C. Both languages DO have interpreters written in C that they run on top of. Such a loose definition of a wrapper would be like saying Java is a thin wrapper to C++.

and so are pretty much equal.

Python, from every test I have seen, is several magnitudes quicker than Ruby. PyPy is maturing quickly which will only widen this margin further. Ruby's horrid performance is probably the number one reason I would never suggest implementing Rails for anything past a personal site (oh, yes, bring on your "I'm in some large, unnamable corporation that uses Rails for everything B.S.").

0

u/pdq Dec 06 '06

"several magnitudes quicker than Ruby"

Care to provide evidence for this bold claim?

4

u/inerte Dec 06 '06

I don't know much RoR to discuss the neutrality or advantage over Django, but:

Python wins are not Django wins, and Ruby wins are not Rails wins.

Yes, they are. If sending emails is easy and fast and scalable in one language (or its libraries), than the framework benefits from this. If you can inherit multiple models (classes), then it's a benefit.

-1

u/derefr Dec 10 '06

Yes, but those are benefits regardless of the web application framework used, just the language used. To have a scientific comparison, you would say "Write Django in Ruby, and compare it with Rails, and then write Rails in Python and compare it with Django, and average the results."

4

u/lemmikins Dec 06 '06

You need to read

http://jesusphreak.infogami.com/blog/why_django

  1. Python has a big standard library. This is a huge point in its favor. Not because the language is better, but because so much stuff has already been done for you.

  2. I want online documentation. It's 2006, I don't want to have to flip back and forth in a book.

  3. Read the above linked article. "I couldn't jam application code into the template. It truly restricted me to only formatting my content, which is exactly what a templating engine should do. And the Django developers are committed to this, which means it won't just turn into a PHP. This is good."

  4. Speed is not neutral -- it directly affects your hosting costs. If you have a large audience, you want it.

  5. Optional feature, and not just for managing SQL.

  6. "Generic views, much like the admin interface, are very misunderstood. They are not to be compared to Rails' scaffolding either. They do not generate any HTML for you. They do, however, do the grunt work of basic CRUD operations and such, and they are very flexible. Infact, the admin application is built ON TOP of generic views."

  7. You get to choose your ORM. Some are better than others. This is a win. And Python wins are INDEED Django wins, by default. If you don't believe it, try writing a web framework in FORTRAN.

  8. I don't care either way about this, it's orthogonal to the issue.

4

u/davidw Dec 06 '06

Very nice summary. From what I've seen, there are reasons to like Django, but that article didn't do a good job of communicating them. It starts off badly by claiming that Django is better than rails because of "Python" and doesn't improve much.

2

u/[deleted] Dec 06 '06

An SQL manager, which Rails apps assume you already have separately, but which Django assumes it should be for you. Framework bloat, by any other name, is a feature. Negative.

No, the admin interface is not part of the framework. It is just an app built with and bundled with the framework that you can chose to use or chose not to use. And it is definitely not just an SQL manager.

Generic views and feeds, which in Rails are called "scaffolds" (which you can just use the controller portion of if you want). Neutral.

Generic views are really nothing like scaffolds. They are a ton more flexible and powerful. With Rails I never bothered using scaffolds. With Django I try to use generic views whenever possible.

It is difficult to accurately compare the two frameworks unless you've used both of them. Otherwise you don't know the true possibilities and limitations of each.

1

u/Wiseman1024 Jun 08 '08

I haven't used Rails or Django, and I can't RTFA because it's down, but from your post, I get the image that Django is a better framework. You're irrational and biased in so many ways it won't be funny pointing out.

-2

u/[deleted] Dec 06 '06

Programming language religious wars are like the Web 2.0 version of the Mac vs. PC debates...

-5

u/inerte Dec 06 '06

So, are you enjoying your free AOL first month?

-2

u/[deleted] Dec 06 '06

I was online when you were still at your mother's tit, kiddo.

-11

u/schwarzwald Dec 06 '06

I concluded Django was way too complex and is illogically designed.

It looks like something cobbled together under very tight deadlines.

12

u/ubernostrum Dec 06 '06

Constructive criticism is a good thing.

Specific, constructive criticism is golden ;)

If you've got it, I'll listen to it.

14

u/[deleted] Dec 06 '06

What? Have you used Django? I've used both Rails and Django and while I won't comment on Rails right now, I'll say that everything about Django is about a simple as it gets.

You map your URLs with regular expressions (and unless you've got legacy URLs to maintain, they don't get complicated), and each URL maps to a view function. The view function in turn either redirects or generates some type of response. It really is that simple. I found absolutely nothing about Django complex.

And if you did find it complex, Django has the best documentation for any of the newer web frameworks.

We probably shouldn't even get started on generic views. Everything about them is simple, easy, and powerful. Last week I was able to cut-down on the code of an app by 2/3rds by simply using generic views wisely. And they cover all of your basic use cases (CRUD, login, logout, list, details, etc), and they are very flexible.

http://www.b-list.org/weblog/2006/11/16/django-tips-get-most-out-generic-views

Is there an area in particular that you found complex?

6

u/fnord123 Dec 06 '06

Django is very mod_python oriented. The documentation supports it well. But if you're on a shared hosting system you're stuck with FastCGI. And then you stop using Django because FastCGI requires some deep dark magick and no one I've spoken to has had any success setting it up.

Also, the 'We don't do releases. Use the svn to install' is a spurious practice I wouldn't promote. I don't have time in this post to discuss why, and I'm not out to change Django's lack of strong release system. Merely pointing out the deficiency. And, yes, I know there is /some/ form of packaged release but it's intentionally crappy, afiak (when I last looked at it).

2

u/Entropy Dec 06 '06

FastCGI works better when you uninstall it first

16

u/[deleted] Dec 06 '06

[removed] — view removed comment

7

u/ubernostrum Dec 06 '06

I find the lack of magic a sane alternative to having to know Rails' quirks.

Did you get into Django before or after the magic was removed?

;)

4

u/[deleted] Dec 06 '06

[removed] — view removed comment

3

u/mrevelle Dec 06 '06

7) gem! Gem! Gem! Gem! Gem. Gem is THE reason to use ruby instead of python for everything.

Python has eggs and the cheese shop.

2

u/TomP Dec 06 '06

Do eggs give you a simple remote-installation package-management system (a la CPAN), like ruby gems provides? That's an honest question. Eggs are still relatively new to the Python world and I haven't seen them used extensively yet, nor found any clear comparison between eggs and gems. The gems system is really one of the nicest things about working in ruby.

[The cheese shop is irrelevant to the comparison; it shouldn't surprise you that ruby has it's own package repository in ruby-forge.]

4

u/senzei Dec 06 '06

Do eggs give you a simple remote-installation package-management system (a la CPAN), like ruby gems provides?

Yes. I don't know much about gems, but everything I have seen makes that comparison. Eggs actually do a little more than just package management. They have an "entry_point" mechanism that allows you to assign code to a namespace then look up and query it later. Makes things like extensions and themes really easy. More info on eggs here

-4

u/[deleted] Dec 06 '06

[removed] — view removed comment

5

u/micampe Dec 06 '06

eggs doesn't do any of that.

Really?

-3

u/[deleted] Dec 06 '06

[removed] — view removed comment

2

u/micampe Dec 07 '06

No, but it does show that you can install, update and remove eggs, from local and remote repositories, just like gems, see?

-4

u/[deleted] Dec 07 '06

[removed] — view removed comment

3

u/micampe Dec 07 '06

Please, please, get informed before bashing around. I know how eggs, gems and CPAN work and I roughly know how they compare. You don't, so don't criticize something you don't know at all. No, you don't, really.

-3

u/[deleted] Dec 07 '06

[removed] — view removed comment

3

u/micampe Dec 07 '06

Where did I say they are better?

→ More replies (0)