Weblog

Snakes and Rubies conference recap

Jacob, Simon and I met in Chicago this weekend for the Snakes and Rubies conference, where I presented Django and David Heinemeier Hansson presented Ruby on Rails.

Turnout was fantastic: More than 100 people showed up and packed themselves into a standing-room-only meeting room at DePaul University.

The Django presentation went quite well, and lots of attendees who hadn't yet tried Django said they were intrigued by the framework and wanted to give it a try. Django even got plenty of kind comments from the Ruby folks, including David himself, who said he'd probably be using Django if he hadn't written Rails. We hope at least some of the Ruby folk will check out Django as a fine competitor to Rails (and Python as a saner Ruby).

A theme to which we returned several times during the event was the similarity between the two frameworks. They certainly have more in common than not, and common "enemies" -- PHP, Java, Perl -- and common philosophies -- beauty, cleanliness, perfectionism -- unite the communities even more.

Still, the frameworks clearly have different opinions on what they should and shouldn't do. For example, David said he has no plans to offer internationalization, an RSS framework, or an admin interface, in Rails proper, because he sees those as outside the scope of the project. Yet Rails includes an Ajax framework, which, one could argue, is just as "high-level" as RSS or internationalization. Django, on the other hand, includes these things but doesn't include an Ajax library (yet). The differences, and well-argued justifications, are fascinating to think about.

Jacob is working on editing video and audio of the presentations, and we're hoping to Web-post those on this site later this week. In the meantime, check out some blog coverage of the event (in no particular order):

Posted by Adrian Holovaty on December 4, 2005

Comments

__SELF__ December 5, 2005 at 9:28 a.m.

you guys need to work on the ease of entry into the framework. There's a lot of dumbasses like me out there who would like to see a nice video of installing django on every major platform, using it to get a quick site up and running. That is the WOW factor in RoR.

Make it easy to install/ and play with and you will gain critical mass. OR YOU WILL DIE. no matter how great your product is. Case in point. SmallTalk/Forth/ etc. I think with Django we have the first Python framework where people are not getting hardons about how ridiculously complicated their code is (case in point: The ZOPE bizzaro world)

Marketing DOES matter. RoR is a good product, marketed ingeniously. If Joe-Six-LOC can't download and play with it in an afternoon. Your Framework is So OVER!

P.S. can't wait for the videos/mp3. Sounds like an interesting event.

Adrian Holovaty December 5, 2005 at 10:30 a.m.

Hey __self__ -- We've got screencasts, etc., planned, but we're waiting to make a couple more core changes before we put together the screencasts. We don't want to spend a bunch of time on screencasts, then have some syntax change that makes the screencasts inaccurate. Stay tuned!

Danno December 5, 2005 at 11:09 a.m.

"Saner Ruby"?

Grr!

I18N and Admin Interfaces I agree with Mr Hansson on. I18N should be a part of the language (and hopefully the core team will shift that to top priority immediately after Ruby 2 goes prime time). And Admin interfaces would, to me, seem to depend on the specifics pretty largely.

RSS might be a different story if there was any sight in end to the format war. At least you can say that all browsers are in support of JavaScript, whatever weird broken version it may be.

nirvdrum December 5, 2005 at 12:14 p.m.

"Enemies"?

I realize it was it quotes, so shouldn't be taken to heart, but throwing terms around like this is what starts flamewars like is commonly seen between the RoR and the Java guys (I'd imagine for other "communities" too, but I only follow the Java stuff). Truth be told, many Java developers are pragmatic and have been inspired by frameworks such as RoR and Django. Tapestry (http://jakarta.apache.org/tapestry/) has really tried to make itself far easier to use with the forthcoming Tapestry 4 release. Trails (https://trails.dev.java.net/) is a project that makes getting up and running with Tapestry very simple, much like RoR and Django. The really cool thing is that you get to leverage the component-based Tapestry underneath.

Anyway, as a traditional Java developer, I admire what you guys are doing. I just hope this little pebble doesn't turn into larger stones being thrown. Keep up the good work.

Cheng Zhang December 5, 2005 at 1:29 p.m.

Hi, nirvdrum. I see no point that people won't take it easy for such light humor. Naturally other programming languages are always the "enemies" of any single programming language, competing for the developer's mind share. Speaking as a C++/Java/Python developer, I'd like to emphasize that all programming languages (also apply to web frameworks and so on) are just tools for us to get the job done, and enjoy the process along the way, if possible. Truth is that in Java world there hasn't really been a well-integrated, yet loose decoupled tool like RoR and Django standing out, despite many fascinating innovations going on. If one day there is one finally, that will certainly be better than today since as developer we have more choices on tools, but only until then.

__SERF__ December 5, 2005 at 4:15 p.m.

Please, fer the luv of gawd.. can we have the slides and the mp3's already?

ahem

Jason Huggins December 5, 2005 at 4:49 p.m.

Yes, even though I was there, I'm eager to get a copy of Adrian's presentation slides. Adrian's presentation was a textbook example of a *great* presentation. Good use of humor, flowed nicely, really sold the case on *why* Django is important and useful. I'd like to borrow the "spirit" of Adrian's slides the next time I present Selenium. I promise not to crib all the wacky pictures.

nirvdrum December 5, 2005 at 9:04 p.m.

Hi Cheng,

Heh. The problem is that you know it's light humor and I know it's light humor, but invariably someone is going to misinterpret it. That's the nature of a text-based medium I guess. I just want to make sure it doesn't explode into the catfights the RoR guys and the Java guys get drawn into ;-)

I do still disagree with your assessment of this "enemies" thing though. Python seemed to get by just fine before I started using it and if I stopped I'm sure it would do just as well. The language remains largely indifferent. Now, the people behind the various languages may have something at stake, but that's not quite the picture you painted. Anyway, I'm not looking to get drawn into anything, so let's just agree to disagree. It's nice to see we can both agree that using the best tool for the job, whatever the tool may be is the best approach to take :-)

Adrian Holovaty December 6, 2005 at 10:54 a.m.

My slides are available for the moment at http://www.holovaty.com/images/presen... .

__SERIF__ December 6, 2005 at 1:05 p.m.

Oh man, that thing is hilarious! I can't wait for the video/audio now! I think a package whose authors have so much sense of humor is bound to attract a lot of attention. It indicates that you are willing to listen to the audience and perhaps laugh at yourself and the world along with the other mere mortals. Don't lose this as you grow.

thanks for the slides, but that only whets the appetite..

Kumar McMillan December 7, 2005 at 1:50 p.m.

Adrian, just wanted to say I thoroughly enjoyed your presentation and was glad you mixed in some comic relief (*essential* when talking about nerd stuff). I also understood exactly what Django has to offer, which is what I needed since I'm too lazy (I pretend "too busy") to try out a Django app for myself. I can already see how Django will be a perfect fit for an upcoming side project I have. David had some interesting new developments to share (with Active Record) but I already had formed the opinion that Rails isn't for me and wasn't swayed away from that, mostly this is due to the insanity of Ruby, not Rails. What surprised me about the event was the Python vs. Ruby debate. I guess I never really expected there to be an actual *debate* because I thought, "that's just silly, who wants to argue semantics?" Both languages have magic that is awesome but can and will bite you in the ass, both make web programming fun and simple, both make working on your legacy PHP site a drag, but Python has better namespacing and abstraction of things like class/function implementation so ha! only kidding. Not worth debating if you ask me.

Jules January 10, 2006 at 2:05 p.m.

Excellent presentation!

I like the idea to specify your attributes in the model and create the database from these attributes semi-automatically. Even better would be to do it fully automatic and create the tables and add columns when you hit the page with your browser to test the code (if this session in development mode, offcourse).

But what I don't like so much about Django is that you have to parse the code in your head to understand what's going on. This includes method naming like:

Article.get_article_list()

I prefer:

Article.find_all

And I know many people don't like "missing" parentheses:

Article.find_all()

But the () is absolutely not necessary. Why not add an extra semi-colon too?? ;-)

And compare:

from django.core.extensions import get_object_or_404, render_to_response
from django.models.polls import choices, polls
from django.utils.httpwrappers import HttpResponseRedirect

def vote(request, poll_id):
p = get_object_or_404(polls, pk=poll_id)
try:
selected_choice = p.get_choice(pk=request.POST['choice'])
except (KeyError, choices.ChoiceDoesNotExist):
return render_to_response('polls/detail', {
'poll': p,
'error_message': "You didn't select a choice.",
})
else:
selected_choice.votes += 1
selected_choice.save()
return HttpResponseRedirect('/polls/%s/results/' % p.id)

vs:

def vote
@poll = Poll.find(params[:id])
@poll.choices.find(params[:choice]).votes.increment!
redirect_to :action => 'show', :id => @poll
rescue
@error = "You didn't select a choice"
end

Python: 708 characters
Ruby: 190 characters

It might be because I'm a Ruby programmer, but the Ruby code is easier to understand ;-)

The admin interface in Django rocks! Rails needs that, maybe an idea for an Engine?

Rails does not have an RSS framework (nor needs, because it has Builder for XML, and learning the RSS api takes longer than writing 1 extra line with Builder), and Django doesn't have AJAX support (nor needs (?) because it is aimed at a CMS-like data management framework (or not?)).

Explicit is better than implicit <=> Less code, Quick development ??

Could someone give code examples of Django that you consider good, Django-like, etc. Or give non-code examples of practical situations where Django is better than Rails (other than the auto-admin-interface versus scaffolding: scaffolding is NOT auto-admin-interface, it is a way to start with your application (just like Python (language) versus Rails (framework) comparison)) <- yes, I have coded some LISP ;-)

Adrian Holovaty January 10, 2006 at 4:18 p.m.

In response to Jules:

> Article.get_article_list()
>
> I prefer:
>
> Article.find_all

Your Django example is incorrect. In Django, it's articles.get_list(). And I prefer get_list() over find_all(). Of course, that's subjective.

> And I know many people don't like "missing" parentheses:
>
> Article.find_all()
>
> But the () is absolutely not necessary. Why not add
> an extra semi-colon too?? ;-)

It's necessary because it says "I'm executing a function" rather than "I'm accessing this variable." In Python, functions are objects that can be passed around. For example, I can pass the articles.get_list method to another function:

do_something_with_method(articles.get_list)

That passes the *function*, not the result of the function. I don't really understand how one would do this (pass a function) in Ruby, but I am not a Ruby programmer.

> It might be because I'm a Ruby programmer, but the Ruby
> code is easier to understand ;-)

As you clearly are annoyed by the fact that calling a function requires a "()", I am equally annoyed by the at signs ("@"). But arguing about syntax is unproductive.

> Rails does not have an RSS framework (nor needs, because
> it has Builder for XML, and learning the RSS api takes
> longer than writing 1 extra line with Builder)

Have you *seen* the Django RSS framework? It's about two conceptual levels higher than Ruby's Builder thing.

Jules January 11, 2006 at 12:29 p.m.

I've certainly seen the RSS framework! Sure it's higher level, and I'm not saying that it isn't nice, it looks great. I'm just saying that Rails doesn't need an RSS framework because 1. Rails is not as specialized as Django (webapplications / data management webapplications) and 2. It's easy to do with builder (but it is certainly nicer with Django's RSS framework)

Whooops, something.get_article_list() would mean the articles associated with something...

You can pass a method like this: yourobject.method(:yourmethod), but you rarely use that because you can use blocks (they're coming to Python too, I hope the standard library will use them for things like map/collect/select(_by) methods).

You can never access something directly in Ruby:
an_article.title would be the title method on an_article. That's why you can strip the parentheses: everything is a method anyway. If you are IN an object:

class YourClass
def your_method
self.a_method
@instance_variable
end
end

self.a_method would call a method just like instance.a_method, and @-variables store instance data.

But Python has good indentation rules (so you don't have end's), that's really nice!

But I still prefer the Rails code for the vote-method, but that's only one example. I'm sure there are cases where Django performs better, and I'd like to see a few code examples!

osakaBoy March 5, 2006 at 6:10 a.m.

Hey guys. I know absolute butkus about this sort of thing, but I'm trying really hard to learn. I'm trying to decide which one to offer to my boss to make our company website with. The trick is, we have to make the site available in many languages. I've seen it written that Rails doesn't support this. Can Django support it?

the_libertine March 6, 2007 at 9:01 a.m.

Let’s just be objective and goal oriented here.

In the end, Python code is no cleaner than Ruby’s as a result of all these rules and I can’t see what’s not to like in an @ sign.

Scope by indentation on the other hand seems to rub more programmers, not just Rubyist, the wrong way. (That’s right Jules, if you really like this feature, you’re in the way way minority on this) Bruce Eckel in his article “The departure of the hyper-enthusiasts” which is skeptical of Ruby, even admitted that it took him months to get over this. This has been sited, even by some Pythonistas, as a major deterrent to language adoption.

I don’t mean to start a flame war; I’m just stating my honest impressions. I program quit a bit more Python than Ruby ( I learned Python first), but I have to say that Ruby seem to have achieved the goals of cleaner, leaner and more readable code, without sacrificing expressiveness/freedom of expression.

Python is a pretty good language; libraries seem to be a bit more mature, it’s faster (at this point, in a few months Ruby 1.9/YARV will likely change that ). Django’s great!

I find the lack of braces/an end marker very counter-intuitive. It could just have been optional. Surely wouldn’t hurt readability.

But, well, I have tried:

>>> from __future__ import braces

Hilarious!

Collin September 23, 2007 at 4:59 p.m.

Hey, looks like the domain expired on the link up there.

Comments are closed

To prevent spam, comments are no longer allowed after sixty days.