What's better about Ruby than Python?

Asun Friere afriere at yahoo.co.uk
Mon Aug 18 03:19:09 EDT 2003


"Brandon J. Van Every" <vanevery at 3DProgrammer.com> wrote in message news:<bhpbc6$1plpe$1 at ID-203719.news.uni-berlin.de>...
> What's better about Ruby than Python?  I'm sure there's something.  What is
> it?
> 
> This is not a troll.  I'm language shopping and I want people's answers.


When I was language shopping python was up to version 1.5.2 (actually
it was probably up to 1.6.1, but not on the system I was using), and
there were a number of distinct advantages that I felt Ruby held over
Python.

First and foremost, everything in Ruby was (behaved like) an object. 
That is now true for Python also.

Secondly you could subclass basic types, again, this is true for
Python as well.

Thirdly the regular expression syntax was Perl-like and built into the
core of the language (althought unlike perl, of course, the syntax
generated an object).  In a way this is unaesthetic, certainly
python's approach is much more consistent with the object oriented
nature of the language.  However, I use regexp so often, and still
find the re module cumbersome in comparison to Perl's way of doing
things, so imho this is still and advantage (ugly as it may be) that
Ruby holds.

Finally I was apprehensive about the 'signigicant whitespace' issue in
Python, and thought that Ruby's approach was safer.  I've definitely
changed my mind on that one.  Now all manner of obsceneties are heard
to eminate from my corner of the room whenever I have to program in a
language which requires me to explicitly delimit blocks @!$*&#!!

Some folks also like the existence of code blocks and iterators in
Ruby, (Well Python has its own kind of iterators now as well,) but
that didn't concern me greatly.

In the end two things persuaded me to go with Python.  Firstly I work
in a 'Perl shop' and I'm supposed to write Perl (which I sometimes
do), my using Python was already considered using an "obscure
language,"  Ruby would have been quite beyond the pale.  More
importantly, Ruby just did not have anywhere near the range of
libraries that Python did.  Specifically Ruby, at that time, did not
have any sensible way of handling XML (ie no SAX or DOM libraries).

In my opinion, most of the advantages Ruby had over Python seem to
have disappeared as Python has developed.




More information about the Python-list mailing list