What's better about Ruby than Python?

Terry Reedy tjreedy at udel.edu
Fri Aug 22 20:29:50 CEST 2003

"Mario S. Mommer" <m_mommer at yahoo.com> wrote in message
news:fzoeyihycs.fsf at cupid.igpm.rwth-aachen.de...
> Lisp is simple.
> (<operator> <item-1> <item-2> ...)
> Where's the problem?

The very uniformity of everything (including operators?) being a
possibly recursive list and the actual practice of relatively deep
(compared to Python and similar languages) nesting.  If a lisp
expression ends with 10 to 20 closing parentheses (which I have seen),
then there were at least 10 to 20 pending operations waiting to be
closed.  This many layers is a bit much for many or most people.
There is also the 'problem' of having to read inside out and
backwards.  Ok for a line or two, less ok for multiple lines.

Consider the opposite extreme for an accumlator-based machine:

Assembly is simple.

<operator> <simple-operand>

Where's the problem?  The very uniformity of doing everything in
sequential baby steps.  Once people learn and understand the baby
steps, bigger chunks like
   discrim = sqrt(b*b-4*a*c)
are easier to grasp than the assembler equivalent.  Empirically, it
seems that most people prefer the mix of steps with expressions to
either extreme of all steps or all expression, even though both
syntaxes express function composition.

> Granted, you need an editor that helps you to match the parens

This may make deep nesting more manageable, but does not make it
shallower.  Yes, one could also write a 10-line, 10-layer expression
in Python, but I doubt I would.

Terry J. Reedy

More information about the Python-list mailing list