[Baypiggies] Official Language War Thread? - Rails vs. Turbogears.

Rich Bodo richbodo at gmail.com
Thu Dec 1 09:10:17 CET 2005


For any interested party, take the subject with a grain of salt, have
a sense of humor, and let's discuss web frameworks in Python and Ruby.

I thought I would share my experiences w.r.t. these two web frameworks
and see how they compare to other peoples.  These are mainly comments
reflecting my first impressions.

Here's where I am: I decided I need to learn to write scalable web
apps.  The reason I'm learning Rails is that I was instructed to do so
by a respectable web programmer (who is working in a Perl shop).

I ignored his advice for a few days and tried Maypole first
(www.maypole.org), but it reminded me that I've never enjoyed reading
Perl.

I've learned enough about Ruby and Rails to write simple CRUD
applications.  In Ruby itself I've written a couple parsers and a
small Rails app.

I've written somewhate less Python - a few small programs. I've
watched the TG Wiki-movie and read the turbotunes tutorial.

Ruby:

Ruby itself is interesting.  Most people love to write very tersely,
but it still looks clean to me.  A typical experience reading ruby
might be (from http://www.rubygarden.org/ruby?AlexNetkachev):

# execute a shell command,
# go through result and create XML in one line :-)

 xp.string = `ls`.inject('<files>') { |xml, file|
    xml << '<file>' << file.chomp << '</file>' } + '</files>'

Personally, I would never write something like that, but even though
it is written as tersely as the author could manage, I can understand
it.  The iterator/code block syntax is probably not familiar to the
Python programmer, but they are the first thing you learn in Ruby.

Ruby seems to leave out every character possible, and somehow it's
still more readable to me than Perl.  Maybe *because* they leave out
so much, you have to read "less".  I think this minimalist aesthetic
is a big part of Ruby's appeal.

Ruby is also a curiosity.  Until getting into the Programming Ruby
book, I had never heard of some of the features that Ruby borrows from
CLU and SmallTalk.  There is a big novelty factor here.

Rails:

Rails, however, is where the aesthetic broke down for me.  Mainly
because I have always recoiled from the popular practice of mixing
code and markup together that is so pervasive in the Rails community. 
I'm having a hard time accepting it.

On the positive side, Rails is very complete, and has a huge and
helpful community.  So, once I get used to it,  it will do what a
framework is supposed to do: allow me to concentrate on my
application.

Python:

The reason I'm on this list is that I have had good experiences
reading Python, and that's a huge factor for me.  I re-read code a
lot.

I can't help noticing that just about every library I download these
days comes with working Python examples and without working Ruby
examples.  Yes, that will change and yes, that was an argument for
Perl over Python in the past, but there is no getting around the fact
that Python is an "established" and for many applications the most
established language.  This is a time saver and, rightly, a confidence
builder.

TurboGears:

First thing I noticed is that, IMHO, the TG folk have a better website
than the RoR folk (but they are both awesome for community porjects). 
This may seem off topic, but the website is  what is going to drive
new members to the community.  The website says a lot about the
momentum and longetivity of the project.  Each time I return the docs
and examples on the TG site keep improving.

At least from what I have seen, the templates look a lot cleaner in
TurboGears (o.k. there is a lot of JavaScript in there but that's
forgiveable). It looks to a beginner that the libraries behind TG are
more mature than the libraries behind Rails, so although TG is clearly
less well established, they get a lot from Python for free.

Overall:

Both of these languages are relatively easy to learn and read. Both of
these frameworks are completely irresistable.  I feel I have to learn
both.  As soon as I master RoR, I can't wait to get into TurboGears.

-Rich
http://rbodo.blogspot.com


More information about the Baypiggies mailing list