How's ruby compare to it older brother python

John Roth newsgroups at jhrothjr.com
Mon Apr 26 14:22:45 EDT 2004


"Phil Tomson" <ptkwt at aracnet.com> wrote in message
news:c6jg7404m at enews4.newsguy.com...
> In article <108pvmgl0h7m3ea at news.supernews.com>,
> John Roth <newsgroups at jhrothjr.com> wrote:
> >
> >"Hunn E. Balsiche" <hunnebal at yahoo.com> wrote in message
> >news:c6ich0$c5mee$1 at ID-205437.news.uni-berlin.de...
> >> in term of its OO features, syntax consistencies, ease of use, and
their
> >> development progress. I have not use python but heard about it quite
> >often;
> >> and ruby, is it mature enough to be use for developing serious
> >application,
> >> e.g web application as it has not many features in it yet.
> >
> >As another poster has mentioned, Ruby is more closely related
> >to Perl than to Python. While I don't use it, people I respect who
> >have moved to Ruby say it has a couple of real killer features;
> >in particular the way blocks and the pervasive use of the visitor
> >pattern come together change the way one writes programs for
> >the better.
> >
> >As far as syntax is concerned, there doesn't seem to be a
> >huge amount of difference. Syntax is syntax, and every language
> >has it's little pecularities.
>
> Well, there is one big difference syntactically: Python uses indentation
> as syntax and Ruby doesn't.  Personally I don't prefer Python's
> 'indentation-as-syntax' since it means that syntactically significant
> pieces of my code are invisible and if the tab settings in my editor are
> not the same as yours it can make it difficult to share code (or even
> worse, it might look like everything is OK when we share code, but the
> code which looks exactly the same to each of us, might not be depending
> on how tabs are or are not expanded). It would also seem to be a pain for
> cutting & pasting code as well.

As I said in another post, indentation is the reason I learned
Python in the first place, but it's not the reason I stay with
the language. In fact, I've come to the very heretical view
that the indentation sensitivity is a language design mistake.
It should be the editor's job to handle that level of detail in
a manner that the developer finds workable.

One reason I think it's a language design mistake is that
it's not recursive. That is, it's not possible to shift from
expression level indentation back to statement level
indentation without major disruptions. This is needed for
embedded blocks.

I think Ruby has a reasonable middle ground here: its use of
'end' is fairly unobtrusive compared to, for example, C, C++,
C# or Java. Even so, I think that a reasonable programming
editor would get them out of my face while I was programming.

The tab issue is one of those relatively inconsequential things
that people seem to love to argue about: I'd rather be able to
tell the editor how I want the program formatted, and have done
with it.

> Phil





More information about the Python-list mailing list