Ruby aesthetics

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING graced us by uttering:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python
aesthetically.

Comments?

I had different opinions and experiences with these two languages.

But I have many acquantances in Guido’s realm, so if your journey
leads you there, give them my regards. I don’t really talk to
them much any more: I chose Ruby.

Tim Hammerquist

···


“The Devil made me do it.”
I have never made one of them do anything. They live their own tiny lives.
I do not live their lives for them.
– Lucifer, The Sandman

Beauty is in the eye of the beholder.

-michael (who hopes this religious war can avoided)

···

On Saturday 31 August 2002 04:16, vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

++++++++++++++++++++++++++++++++++++++++++
Michael C. Libby x@ichimunki.com
public key: http://www.ichimunki.com/public_key.txt
web site: http://www.ichimunki.com
++++++++++++++++++++++++++++++++++++++++++

At least some of us in this (Ruby) group, including myself, find “economy of
expression” a highly aesthetic phenomenon,
so if it is possible to demonstrate that for any given Ruby
statement/expression there is a shorter, more terse Python equivalent, you
will have us converted.

vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote in message
news:slrnan10n5.oei.vegai@lorien.it.jyu.fi

···

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

Troll?

···

On Saturday 31 August 2002 04:16 am, vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

Sounds to be a very fertile remark :)))

This isn’t slashdot, if you want to start a flame war don’t make it so
obvious.

Besides, everyone knows INTERCAL has the best syntax.

···

On August 31, 2002 05:16 am, vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?


To call me “awesome” is an understatement.

I’ve used both Ruby and Python for delivering production applications.
My opinion is that Python syntax is more elegant than that of Ruby when
your code uses existing classes. However, Python syntax is less
elegant than Ruby when you define new classes, because of all the
underscores and explicit self parameters. However, as code evolves, one
ends up writing more and more classes, so I find that Python code starts
off very readable but gradually becomes less so, while Ruby code stays
as readable as it evolves.

Python’s evolution has left it with a mix of primitive and object types
(also fixed in the latest versions), built-in functions that should be
methods (“map”, for example), reserved words that should be methods
(“in” for example), etc. I find that Ruby’s model of “everything is an
object” makes code more elegant, and it’s easier to find the right
method in the documentation.

Ruby code becomes significantly more elegant when you use blocks to
extend the language; To achieve something like the same effect, Python
requires lambda expressions, additional functions, or implementations of
“magic” methods with lots of double-underscores in them. The lack of
lexical scoping is a drawback in Python, because it makes local
functions much less useful as an alternative to blocks, although this
fixed in the lastest versions if you import scopes from future.

Cheers,
Nat.

···

On Sat, 2002-08-31 at 10:16, vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?


Dr. Nathaniel Pryce, Technical Director, B13media Ltd.
Studio 3a, 22-24 Highbury Grove, London N5 2EA, UK
http://www.b13media.com

My two reasons for disliking Python’s aesthetics:

  • indentation-as-syntax

    At first I thought it was a nice idea, but I actually find
    it difficult to read. A class definition, especially,
    should have an explicit end. Most importantly, though,
    it’s not advanced-editor friendly.

  • explicit “self” parameter to methods

    I absolutely detest this. I had to stop reading my
    Python book when I discovered this. I picked it up again
    recently to find out if the nightmare was actually true.
    It was.

My (main) reason for liking Ruby’s aesthetics:

  • it’s terse

Seeya!

Gavin

···

----- Original Message -----
From: vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, August 31, 2002 7:16 PM
Subject: Ruby aesthetics

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

Many check into Ruby quite a lot, and they like its clean syntax.

Then comes Python, which they find is inferior to Ruby aesthetically.

Comments?

···

On Sat, Aug 31, 2002 at 06:16:50PM +0900, vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

At least some of us in this (Ruby) group, including myself, find “economy
of
expression” a highly aesthetic phenomenon,
so if it is possible to demonstrate that for any given Ruby
statement/expression there is a shorter, more terse Python equivalent, you
will have us converted.

vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING wrote in message
news:slrnan10n5.oei.vegai@lorien.it.jyu.fi

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

I too suspect this may be a simple troll.

However, I do find Python’s idea of meaningful
indentation interesting. It does make the code
shorter and a little less cluttered. Though I
can understand why many people would not like
it.

If there are other issues, tell us about them.

Hal

···

----- Original Message -----
From: “Shashank Date” ADATE@kc.rr.com
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, August 31, 2002 10:37 AM
Subject: Re: Ruby aesthetics

Thank you, sound reply – I’ll stick with my choice.

(to the rest of you: that wasn’t a troll. Learn some manners, even
if this is usenet)

···

In article slrnan12tq.h8d.tim@vegeta.ath.cx, Tim Hammerquist wrote:

vegai@nic.fi.GOTSOMUCHSPAMKEEPITCOMING graced us by uttering:

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python
aesthetically.

Comments?

I had different opinions and experiences with these two languages.

But I have many acquantances in Guido’s realm, so if your journey
leads you there, give them my regards. I don’t really talk to
them much any more: I chose Ruby.


V.K.

Gavin Sinclair graced us by uttering:

My two reasons for disliking Python’s aesthetics:

  • indentation-as-syntax

    At first I thought it was a nice idea, but I actually find it
    difficult to read. A class definition, especially, should
    have an explicit end. Most importantly, though, it’s not
    advanced-editor friendly.

I’ve never found it difficult to read, and actually was really
excited about it. I found a few instances where it was a bit
awkward, but overall I thought it was a good idea. Editors do
seem to have trouble with it at times, but I didn’t notice a huge
problem.

In the end, though, I don’t miss it as much as I thought I would.

But this is also the greatest way in which Python has contributed
to the modern coding community. For example, I’ve never, ever,
ever seen a Python function definition like this.

def foo(arg1, arg2)
do_stuff()
do_some_more_stuff()
while some_condition:
do_some_conditional_stuff()
for var in some_list:
do_more_stuff_with(arg1)

…I wish I could say the same for Perl. :wink:

  • explicit “self” parameter to methods

    I absolutely detest this. I had to stop reading my Python
    book when I discovered this. I picked it up again recently
    to find out if the nightmare was actually true. It was.

I agree totally, completely, and unrelentingly. I didn’t like
‘this’ in C++, I didn’t like ‘my $self = shift;’ in Perl, and I
really didn’t like Python’s ‘self’ shattering my dreams that
Python might actually be an elegant OO language.

My (main) reason for liking Ruby’s aesthetics:

  • it’s terse

Yes. All in all, I think that Python is a refreshingly “clean”
language, syntactically.

Ruby, however, I find both fun and useful.

Tim Hammerquist

···


If you had two people with a motive, and one of them
was alive, who would you arrest?
– Inspector Boot, “Theater of Blood”

May I add:

  • lots of useless ‘_’ everywhere…
···

On dimanche, sep 1, 2002, at 03:12 Europe/Paris, Gavin Sinclair wrote:

  • indentation-as-syntax
  • explicit “self” parameter to methods


Luc Heinrich - lucsky@mac.com

Hi,

I just want to add that in my opinion, what really make Python so popular
are, among other things:

1) Indentation-based syntax
2) "There is only one way to do it"

I think 1) at the time Python was introduced (several years ago) was
really “revolutionary” (well, yes, there were already several non-popular
languages that were indentation-based such as ABC(?)), as all other
mainstream languages such as C/C++, Java, and Perl have the free-form
syntax. Making the syntax to be indentation-based really enforces clean
coding, independent of the programmer’s discipline.

Regarding 2), combined with 1), it really just makes all Python codes very
consistent. We know what exactly to write to accomplish something, and it
is very rare that we encounter a cryptic code. I am still grieving that
Ruby carries Perl’s idiom of statement modifier

..... if/unless/while/until .....

Also, in Ruby there are several method synonyms, such as Array
"indexes" and “indices”, which unnecessarily add more complications to the
language.

I think these are several reasons why not all people migrated from Python
to Ruby. (And of course we all know the superiority of Ruby to
Python, right? :slight_smile: ) I am just speculating, that, since Ruby was written
after Python was introduced, if these two factors (among other
things) have been taken into Ruby, probably Ruby had replaced Python to a
great extent…

Regards,

Bill

vegai@nic.fi graced us by uttering:
[ snippage ]

(to the rest of you: that wasn’t a troll. Learn some manners,
even if this is usenet)

You post did seem very troll-like, and I don’t fault anyone for
taking it as such. You’re asking a roomful of Ruby users what
they think of Python, and providing a criterion for which Python
is well known and boasts highly of. What exactly did you expect
to happen?

However, if you thought this thread was abusive, please don’t
ever, ever, ever go to comp.lang.perl.misc or
comp.lang.smalltalk; you’ve been warned.

Happy coding and safe posting! :wink:

Tim Hammerquist

···


Tegan’s always being posessed! She just wants attention.
– Adric, Doctor Who

Gavin Sinclair graced us by uttering:

My two reasons for disliking Python’s aesthetics:

  • indentation-as-syntax

    At first I thought it was a nice idea, but I actually find it
    difficult to read. A class definition, especially, should
    have an explicit end. Most importantly, though, it’s not
    advanced-editor friendly.

I’ve never found it difficult to read, and actually was really
excited about it. I found a few instances where it was a bit
awkward, but overall I thought it was a good idea. Editors do
seem to have trouble with it at times, but I didn’t notice a huge
problem.

In the end, though, I don’t miss it as much as I thought I would.

But this is also the greatest way in which Python has contributed
to the modern coding community. For example, I’ve never, ever,
ever seen a Python function definition like this.

def foo(arg1, arg2)
do_stuff()
do_some_more_stuff()
while some_condition:
do_some_conditional_stuff()
for var in some_list:
do_more_stuff_with(arg1)

…I wish I could say the same for Perl. :wink:

Since Perl has braces-as-syntax instead of
invisible-undetectable-because-its-not-there-whitespace-as-syntax, you can get
vim/emacs/whatever to reindent Perl for you.

Of course, you never need to reindent Python code, except for when:

  • you want to change the indent level from 8 to 3, e.g.
  • you cut and paste some code into a loop

My objection may not play out much in practice (I’d never practice it because
of the explicit self parameter!), but it is a very strong (and stubborn)
philosophical objection for me.

  • explicit “self” parameter to methods

    I absolutely detest this. I had to stop reading my Python
    book when I discovered this. I picked it up again recently
    to find out if the nightmare was actually true. It was.

I agree totally, completely, and unrelentingly. I didn’t like
‘this’ in C++, I didn’t like ‘my $self = shift;’ in Perl, and I
really didn’t like Python’s ‘self’ shattering my dreams that
Python might actually be an elegant OO language.

Nicely put.

Tim Hammerquist

I’ll conclude with one (new) feature from Python that makes me green with envy:
list comprehensions. For those who don’t know what that means, here’s an
example:

Ruby: squares_less_than_10 = numbers.find_all{|i| i<10}.map{|i| i^2}

Python: squares_less_than_10 = [x^2 for x in numbers if x < 10]

Don’t get me wrong, I love Ruby’s powerful array-manipulation capabilities.
But list comprehensions are soooo cooool!

Cheers,
Gavin

···

----- Original Message -----
From: “Tim Hammerquist” tim@vegeta.ath.cx

I beg to differ. The underscores in Python are far from useless:

_foo() is a (pseudo-) protected method*
_bar() is a (pseudo-) private method*
foobar() is a voodoo method (unless it’s init or del)
class
lets you use self-explanatory names without conflict
with reserved words

Now if you called them ugly, I’d be the first to agree with that.
Personally I think the underscore character should be eradicated from
the face of the earth. Call me weird, but I like the LISP convention of
everything lowercase and hyphenated.

  • Python deliberately lacks true access control, the idea being that
    “we’re all adults here.” So ‘protected’ just means the name doesn’t
    get exported, but you can still access it in qualified form;
    ‘private’ means the name gets mangled so that you would have to
    write some really ugly code to get at it.
···

On Sun, Sep 01, 2002 at 06:53:40PM +0900, Luc Heinrich wrote:

On dimanche, sep 1, 2002, at 03:12 Europe/Paris, Gavin Sinclair wrote:

  • indentation-as-syntax
  • explicit “self” parameter to methods

May I add:

  • lots of useless ‘_’ everywhere…


Matt Gushee
Englewood, Colorado, USA
mgushee@havenrock.com

Luc Heinrich wrote:

May I add:

  • lots of useless ‘_’ everywhere…

If you don’t delimit one kind of thing you must delimit another. So do you
prefer even >more< useless @ everywhere??

···


Phlip
I gotta have my orange juice. | Jesu, Juva
– Have a :slight_smile: day –

Hello. I’ve been checking into python lately quite a lot, and I
like its clean syntax.

Then comes Ruby, which I find is inferior to python aesthetically.

Comments?

That, is a troll Sir. Which isn’t to say that it can’t also be a
sincere question.
Besides that detail, your tone calls your own manners into question.

In this thread you’ve been called a troll once or twice, the possibility
of you trolling was raised (and your question still addressed), and some
folks have mocked your skill at trolling. These are all reasonable and
expected results of your post to anyone who read it.

There was also a polite and constructive discussion of Python that
seemed to be what you were looking for.
In my own damn opinion you were treated better than you deserved.

Kevin

···

Thank you, sound reply – I’ll stick with my choice.

(to the rest of you: that wasn’t a troll. Learn some manners, even
if this is usenet)


V.K.