Hacker News new | ask | show | jobs
by ladyrassilon 5456 days ago
As someone who's been using Django since the magic removal branch, its documentation is top notch, not to mention the lack of magic makes it very usable, supportable, and build-able on. I can say definitely what's going on from the top layer to the bottom layer without any black box behaviour.

Rails is full of sloppy coding, lots of magic, coders who think that return is an keyword, and bad practices. I have no problem with ruby as a language, even if it takes flexibility a step too far, however the style of coders, and the general "I did something clever and unreadable so I'm awesome" attitude seems to permeate the ruby-verse. Also while many improvements have been made on the ruby interpreters... the performance is STILL lagging behind Python, which as a dynamic language with compiled backend elements, gives languages like Java a run for their money.

Both systems are very powerful, Django has certain batteries included that I find it strange that rails fails to do (namely a plugabble extensible flexible user authentication system) and both have their adherents.

The writer of this original piece is clearly not very up on Django development, the strong community apparently how to write well implemented MVC code. Having spent years working with a variety of frameworks, I've yet to find a place where Django stops you doing what you want (unless its a fundamentally stupid idea).

4 comments

the performance is STILL lagging behind Python

It's hard to benchmark these things with accuracy and impartiality, but there's not a significant gap between them anymore. For example (see JRuby here):

http://shootout.alioth.debian.org/u32/which-programming-lang...

I just ran an identical-technique-almost-identical-code recursive fibonacci benchmark against Python 2.6.1, Ruby 1.9.2, and JRuby 1.6.1 and got times of 17.4s, 7s, and 3.2s respectively. (Undoubtedly you could find benchmarks where Python wins, but this is an interesting test of a common algorithm nonetheless.)

Perhaps in real world tests there are places where performance can be made up, but at its core, Python isn't showing much improvement over Ruby nowadays until you start to use things like PyPy (which is, I admit, totally awesome).

Its a keyword, but its not needed (as its not needed in many modern languages) but many rubyists I've worked with said that it was a nice feature that the return keyword was unnecessary and did not use it.
> but its not needed

Depends. It's needed for non-local returns (returning from within blocks), and it's also useful for early returns within methods.

It's not needed for the final return of a method, or a normal exit from a block (not a bad thing in my opinion, and Python's lambda do the same)

> coders who think that return is an keyword

What makes you think it isn't?

I had to google 'django magic removal branch' just because it sounded so cool:

https://code.djangoproject.com/wiki/RemovingTheMagic

I think your experience with Rails (and the community) may be a little out of date. Check out wycats' changes in Rails 3.0 to see where most of the cleanup happened. There's a lot less magic than there used to be.

As far as authentication and admin sections, I guess it just depends on your preferences for which pieces should be included in a framework and which users should have a choice over. Authentication is often app-specific enough that it's hard to drop in different solutions and have them act equivalently.

The simplicity and plugability of django's authentication system gives you as much as you need and as much as you want, if it doesn't provide something then you can reuse it. I can't think why I'd want to "choose" between different systems that should be provided in the core functionality.

The admin is not the auth system, you are not forced to use it and in fact its disabled by default in every single django startup app. I've in the past done my own functionality pages, and would use Admin when it was most suitable.

Personally I haven't seen anything in Rails 3.0 that makes me think "ooh this is a killer feature" the only thing that rails had over Django was migrations, and South closed that hole up years ago.

I'm going to to reinvestigate Rails 3 soon, however my concerns with magic are related as much to the coding style as the overal magical structure. One of the reasons I understand Django so well is the well written code, the other being that it is clean and well designed as a system.

José Valim has written a book[1] that shows how to swap in all manner of functionality into Rails 3. It covers alternate renderers (PDF), alternate models, alternate template stores (SQL), custom template engines, using the built-in notification system, and alternate backends for I18n.

I highly recommend it.

[1] http://pragprog.com/book/jvrails/crafting-rails-applications