From: Michael Schneider Date: 2002-09-02T01:18:41+09:00 Subject: Re: Ruby aesthetic --------------040300050302040604070200 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Bruce Williams wrote: >>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 >> > >I like list comprehensions (they're somewhat Haskell-ish), but, as many of my >pythonesque friends have stated, "they're not very true to python's syntax." >And, in this form, perhaps a little ugly. > >Basically, I don't think this is a shoe that matches what Python is wearing. > > A little background so you get a feel where I am comming from: From a language Point I come from: LISP/ CLOS/ C++/ Modula3/ Various AI languages/ Java From a scripting point: I started with perl 4, then switched to Python 1.2, and have been then since, I have looked at Ruby a couple of times, but went back to python. (case must be strong 'nuff to drive a change). Lately, I have been working with integration Scripting and C++ for rapid development. I am looking at ruby again, the key things that I like about python: * functions as first class entities * Ability to use multi-processor machines (I have a number of multi-processor SGI's to use But the most valuable to me is the support of fundamentally different approaches to software development in the same language Some Examples:: *Pure OO model with mutiple inheritance (Ruby seems to support this with modules for mixins *Pure functional (Ruby seems to have some support for this, but not as strong as Python * Simple script, (no objects) This multiple-technique support is one of the reasons that I like python. (Note: this is not a Ruby Flame, I do like Ruby's: * end statement rather then indent * Ruby Code Block * iterator model (this probably drove python's iterator model) * GC Model ####################### What I really Like ################################################ There are 2 strong languages, with similar core techniques that draw from each other. I am a big fan of competition. I think that competition works. Competition in an open source environment adds a very nice twist. It allows for cross-pollination between the language (Pyton now has support for full closures and iterators). Ruby may get list comprehension. Ruby may get native threads...... In short: I like ruby, and I like python, but I really like having them both :-) Thanks for the great language, Mike --------------040300050302040604070200 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit

Bruce Williams wrote:
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

I like list comprehensions (they're somewhat Haskell-ish), but, as many of my
pythonesque friends have stated, "they're not very true to python's syntax."
And, in this form, perhaps a little ugly.

Basically, I don't think this is a shoe that matches what Python is wearing.


A little background so you get a feel where I am comming from:

From a language Point I come from:

LISP/ CLOS/ C++/ Modula3/ Various AI languages/ Java

From �a scripting point:
I started with perl 4, �then switched to Python 1.2, and have been then since, �I have looked at Ruby a couple of
times, but went back to python. (case must be strong 'nuff to drive a change).

Lately, I have been working with integration Scripting and C++ for rapid development.





I am looking at ruby again, �the key things that I like about python:

* functions as first class entities
* Ability to use multi-processor machines (I have a number of multi-processor SGI's to use

But the most valuable to me is the support of fundamentally different approaches to software development in the same language

Some Examples::
��� *Pure OO �model with mutiple inheritance � (Ruby seems to support this with modules for mixins
��� *Pure functional �(Ruby seems to have some support for this, but not as strong as Python
��� * Simple script, (no objects)


This multiple-technique support is one of the reasons that I like python. (Note: this is not
a Ruby Flame, �I do like Ruby's:
� � * end statement rather then indent
� � * Ruby Code Block
� � * iterator model (this probably drove python's iterator model)
� � * GC Model



####################### What I really Like ################################################

There are 2 strong languages, with similar core techniques that draw from each other. �I
am a big fan of competition. �I think that competition works. �Competition in an open
source environment adds a very nice twist. �

It allows for cross-pollination between the language (Pyton now has support for full closures and
iterators). �Ruby may get list comprehension.
�Ruby may get native threads......



In short: �I like ruby, and I like python, but I really like having them both :-)

Thanks for the great language,
Mike

--------------040300050302040604070200--