[Fwd: Re: who uses Python or Ruby, and for what?]

From: Eugene.Leitl@lrz.uni-muenchen.de
Date: Tue May 01 2001 - 18:46:22 MDT


A voice from the void.

-------- Original Message --------
From: "Bob Alexander" <bobalex@home.com>
Subject: Re: who uses Python or Ruby, and for what?
To: "Python List" <python-list@python.org>

> is anyone using Python or Ruby for anything substantial and
> product-quality, or are these languages only good for writing quick
> little unsupported hacks?

I'm currently involved in a substantial software development project much of
which is written in Python. Originally most of the code was C/C++ with bits
of Perl, Python, shell scripts, etc. (It's for the Unix platform.) Over the
last year or so, we've been switching as much as possible to Python. As an
ancient software guy with lots of experience on all the major platforms and
with lots of development environments, languages, and what have you, my take
is that our conversion to Python has been a very pleasant experience (just
as we anticipated would be). I believe Python is well-suited to sizeable
software projects. As you would expect, the overall process is much more
productive (and more fun!) than doing similar jobs with C/C++. The main
downside to use of Python, as with any "dynamically-typed" language, is that
few errors are caught at compile time, but must be found at run time. So
it's a good idea to do plenty of coverage-oriented testing. Of course, even
strongly-typed languages don't catch everything at compile time either --
it's a matter of degree. But, all in all, Python gets a big thumbs up from
me and my co-workers in the context of our product. It's definitely not just
for quick hacks -- it is a serious development tool. Of course, be aware
that Python not as fast as C (yet it is not a slouch either), so that would
be a factor in making the choice.

Now -- about Ruby. I have recently become aware of Ruby, and I REALLY LIKE
IT! Although we are not scrapping our Python code to rewrite it in Ruby, I
have pretty much switched over to it for my personal stuff. Even though
Python is a nice, clean language, Ruby is even cleaner. It's a step closer
to what Python wants to be for Python 3000 that Python is now: a "pure"
object oriented language rather than a hybrid. And most of the things that I
find rather annoying about Python are done right in Ruby. As a small
example, to read lines of a file, the idomatic code is:

Python 2.0 (can you cite another language that requires 4 lines of
overhead to read lines?)
  while 1:
    line = file.readline()
    if not line:
      break
    <process the line>

Python 2.1 (finally! -- better, shorter, but wierd!)
  while line in file.xreadlines():
    <process the line>

Ruby (uses a general language feature (that Python does not have),
rather than a special purpose, rather hacky, technique)
  while line = file.gets()
    <process the line>
  end

On use of Ruby for large projects: Ruby seems to have all the software
engineering goodness that Python has, so I would think that Ruby and Python
would be in the same ballpark for big development.

Contrasting Ruby and Python:
  - Python is older, more mature, and has more 3rd-party support.
Object-orientedness seems to be an afterthought. Shortcomings in
expressiveness require excessively verbose code in some cases.
  - Ruby is pure object oriented, has a extremely well-chosen set of
language features, in my experience is very solid, and even more fun to code
than Python. 3rd-party stuff is not as extensive as Python's yet, but there
is already quite a bit and its growing.
  - In many ways, the languages are surprisingly similar. Converting
existing Python programs to Ruby is really easy.

In summary, both are excellent languages, suitable for substantial software
development. I am glad to see the growing interest in Ruby, because it
deserves be noticed as a worthy alternative to Python, Perl, etc.

Bob

-- 
http://mail.python.org/mailman/listinfo/python-list



This archive was generated by hypermail 2b30 : Mon May 28 2001 - 10:00:01 MDT