Choosing ruby?

I’m a Python - OO developer (on Win2K) and a few days ago one friend
of mine (a Java developer) says to me: “switch to Ruby, is better than
Python and is Object Orientation is more pure than Python…”

Then (I have no problems switching to Ruby) I asked myself: " why I
have to do that " ?

Could anyone answer for me?

···


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

I’m a Python - OO developer (on Win2K) and a few days ago one friend
of mine (a Java developer) says to me: “switch to Ruby, is better than
Python and is Object Orientation is more pure than Python…”

Then (I have no problems switching to Ruby) I asked myself: " why I
have to do that " ?

You don’t. Python is a very capable language. That said, many people with
Python experience have decided Ruby better suits their needs.

Could anyone answer for me?

This has been discussed on ruby-talk before, and you might want to check out
previous threads:

http://www.ruby-talk.org/cgi-bin/vframe.rb?key=Python&cginame=namazu.rb&dbna
me=ruby-talk&max=50&whence=0

James

···


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

Rhymes wrote:

I’m a Python - OO developer (on Win2K) and a few days ago one friend
of mine (a Java developer) says to me: “switch to Ruby, is better than
Python and is Object Orientation is more pure than Python…”

Then (I have no problems switching to Ruby) I asked myself: " why I
have to do that " ?

Could anyone answer for me?


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

When I was looking for a better programing language to suit one my problems
I first turned to python. I done several script in Python but wasn’t
pleased with couple things I didn’t find in Python, or at least in
documentation. When I first started learning Ruby I liked most certain
features from E my favourite language from Amiga days, which in python
didn’t look so similar. It might be a matter of taste in this case.

Things I like:
-readable and clear syntax
-eval function
-flexibility of the language
-ability so self document extention modules

Things for improvement:
-better GUI suport on Linux

···


Jacek Podkanski

I’m a Python - OO developer (on Win2K) and a few days ago one friend
of mine (a Java developer) says to me: “switch to Ruby, is better than
Python and is Object Orientation is more pure than Python…”

Then (I have no problems switching to Ruby) I asked myself: " why I
have to do that " ?

I think there’s no compelling reason to switch. I don’t know Python,
but I understand it’s very powerful, more so since 2.2.

If you do try out Ruby, please let us know what you think.

" avevo Halo, poi è arrivata la mia fidanzata :wink: "

Traduco?

Hal

···

----- Original Message -----
From: “Rhymes” raims@dot.com
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, August 11, 2002 12:25 PM
Subject: Choosing ruby?

Thanks for the link. I decided to take a look at the Ruby doc (I’ve
downloaded ruby 1.66 package for win containing a whole book) but I
think I’ll don’t like much its syntax cause I don’t like Perl’s at
all…

···

On Sun, 11 Aug 2002 18:08:05 GMT, " JamesBritt" james@jamesbritt.com wrote:

You don’t. Python is a very capable language. That said, many people with
Python experience have decided Ruby better suits their needs.


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

When I was looking for a better programing language to suit one my problems
I first turned to python. I done several script in Python but wasn’t
pleased with couple things I didn’t find in Python, or at least in
documentation.

What do you mean?

Things I like:
-readable and clear syntax
-eval function
-flexibility of the language
-ability so self document extention modules

Things for improvement:
-better GUI suport on Linux

Are you meaning Python’s or Ruby’s? (I think Python’s…)

···

On Sun, 11 Aug 2002 19:17:50 +0100, Jacek Podkanski jacekpodkanski@supanet.com wrote:


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

Do you speak Italian?

···

On Sun, 11 Aug 2002 20:55:37 GMT, “Hal E. Fulton” hal9000@hypermetrics.com wrote:

Traduco?


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

Hello –

···

On Mon, 12 Aug 2002, Rhymes wrote:

On Sun, 11 Aug 2002 18:08:05 GMT, " JamesBritt" james@jamesbritt.com > wrote:

You don’t. Python is a very capable language. That said, many people with
Python experience have decided Ruby better suits their needs.

Thanks for the link. I decided to take a look at the Ruby doc (I’ve
downloaded ruby 1.66 package for win containing a whole book) but I
think I’ll don’t like much its syntax cause I don’t like Perl’s at
all…

Many, many Ruby programmers don’t like Perl’s syntax at all :slight_smile: I’d
encourage you to keep looking at Ruby. I think you’ll find that in
many ways it’s more different from Perl than one might think at first.

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

Rhymes wrote:

Thanks for the link. I decided to take a look at the Ruby doc (I’ve
downloaded ruby 1.66 package for win containing a whole book) but I
think I’ll don’t like much its syntax cause I don’t like Perl’s at
all…

Not to worry, the syntax of Ruby is (IMHO?) alot cleaner than Perls, and
even cleaner than Pythons in a few regards (the reason I prefer Ruby
over Python).

Deducting that you won’t like Ruby syntax based on not liking Perl
syntax is sort of like saying that you won’t like steak because you hate
liver. You’ll change your mind, unless you are a vegetarian :slight_smile:

···


([ Kent Dahl ]/)_ ~ [ http://www.stud.ntnu.no/~kentda/ ]/~
))_student
/(( _d L b_/ NTNU - graduate engineering - 5. year )
( __õ|õ// ) )Industrial economics and technological management(
_
/ö____/ (_engineering.discipline=Computer::Technology)

You don’t. Python is a very capable language. That said, many
people with
Python experience have decided Ruby better suits their needs.

Thanks for the link. I decided to take a look at the Ruby doc (I’ve
downloaded ruby 1.66 package for win containing a whole book) but I
think I’ll don’t like much its syntax cause I don’t like Perl’s at
all…

Hm. I tend to think Ruby syntax is more like Java or C than like Perl,
though there are a few Perlisms.

James

···

On Sun, 11 Aug 2002 18:08:05 GMT, " JamesBritt" james@jamesbritt.com > wrote:


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

Rhymes graced us by uttering:

You don’t. Python is a very capable language. That said, many
people with Python experience have decided Ruby better suits their
needs.

Thanks for the link. I decided to take a look at the Ruby doc (I’ve
downloaded ruby 1.66 package for win containing a whole book) but I
think I’ll don’t like much its syntax cause I don’t like Perl’s at
all…

Yup, with an anti-Perl attitude that strong, you’re definitely a
Pythonista. =)

Honestly, I started using Perl. On recommendation from a Perl user on
comp.lang.perl.misc, I tried Python and I was very pleased with how
clean Python’s syntax was. I then looked into Ruby due to a similar
recommendation.

Ruby initially looked like a cross between Python and (GASP!) VB
(because of the “end” keyword). But I’d also heard a lot of OO
advocates sing Ruby’s praises wrt it’s object model… And they were
right!

Perl’s OO model is a nasty, ugly hack. But it’s regex support is
unmatched. However, (and this ticks off Pythonistas to no end) I see a
poetry and beauty in Perl’s syntax. But this doesn’t mean it’s perfect
(or even a remotely good idea) for other languages.

Python’s OO model is still quite awkward for me (Py v2.2), thought it
is making a lot of progress. It has regex support, but is also very
awkward because of the seemingly forced object interface, reminding me
(unpleasantly) of Java. OTOH, I LOVE Python’s indentation-based
statement grouping! Oh yeah, Python’s threading is quirky on some
systems.

Ruby is neither of the above languages.

  • It supports regex’s in both an object interface (a la Python) and
    via Perl-style variables.

  • Ruby’s object system is beautiful, elegant, and practical. It’s
    much more “pure” (in the Smalltalk definition) than either Perl or
    Python and allows you to retroactively modify pre-existing instances
    of an object at runtime by modifying their class. (See
    http://www.unr.nevada.edu/~tahammer/hack/ruby/ for an example).

  • Its syntax contains elements of Perl’s regexps, but any perceived
    similarity to Perl’s variable system is strictly coincidental. eg:

            Perl                    Ruby
            ----                    ----
    
    var     <illegal var name>      lexical variable
    
    Var     <illegal var name>      constant lexical variabls
    
    $var    scalar variable         global variable
    
    @var    array variable          object instance variable
    
    @@var   <illegal>               class variable
    

    Any variable can hold any type of data. The format of the
    variable’s name merely dictates how it may be accessed.

Alright, so it’s obvious I like Ruby. =) I use it for admin, editor
scripting (Vim http://vim.sf.net), and medium to larger projects.

My only hope is that you take Ruby for what it is, and not for what it
might resemble at a glance.

Happy coding!
Tim Hammerquist

···

" JamesBritt" james@jamesbritt.com wrote:

BOUNDARY, n. In political geography, an imaginary line between to nations,
separating the imaginary rights of one from the imaginary rights of the other.
– Ambrose Bierce, The Devil’s Dictionary

Traduco?

Do you speak Italian?

Heh, no. One semester only, long ago.
What does the quote mean?

Hal

···

----- Original Message -----
From: “Rhymes” raims@dot.com
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, August 12, 2002 3:07 AM
Subject: Re: Choosing ruby?

On Sun, 11 Aug 2002 20:55:37 GMT, “Hal E. Fulton” > hal9000@hypermetrics.com wrote:

Rhymes wrote:

···

On Sun, 11 Aug 2002 19:17:50 +0100, Jacek Podkanski > jacekpodkanski@supanet.com wrote:

When I was looking for a better programing language to suit one my
problems I first turned to python. I done several script in Python but
wasn’t pleased with couple things I didn’t find in Python, or at least in
documentation.

What do you mean?

Things I like:
-readable and clear syntax
-eval function
-flexibility of the language
-ability so self document extention modules

Things for improvement:
-better GUI suport on Linux

Are you meaning Python’s or Ruby’s? (I think Python’s…)


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

I mean Ruby

Jacek Podkanski

Hi –

  • Ruby’s object system is beautiful, elegant, and practical. It’s
    much more “pure” (in the Smalltalk definition) than either Perl or
    Python and allows you to retroactively modify pre-existing instances
    of an object at runtime by modifying their class. (See
    http://www.unr.nevada.edu/~tahammer/hack/ruby/ for an example).

Or even by adding methods to the object itself:

str = "Ruby is an extraordinary language."
def str.vowels
scan(/[aeiou]/)
end
p str.vowels
=> [“u”, “i”, “a”, “e”, “a”, “o”, “i”, “a”, “a”, “u”, “a”, “e”]

David

···

On Mon, 12 Aug 2002, Tim Hammerquist wrote:


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

Yup, with an anti-Perl attitude that strong, you’re definitely a
Pythonista. =)

:slight_smile:

Honestly, I started using Perl. On recommendation from a Perl user on
comp.lang.perl.misc, I tried Python and I was very pleased with how
clean Python’s syntax was. I then looked into Ruby due to a similar
recommendation.

Mmm my (little) Perl experience was terrible. I know that is very
powerful (especially in regular exp. and text manipulation). But when
I “met” Python (I was going to develop in Java) I claimed: “
wonderful! It has nothing wrong ;-)” [it’s not true, of course]

Ruby initially looked like a cross between Python and (GASP!) VB
(because of the “end” keyword). But I’d also heard a lot of OO
advocates sing Ruby’s praises wrt it’s object model… And they were
right!

I heard them too. I like XP programming and TDD and other developers
suggested to me to switch to Ruby (they are Java or .NET programmers)
for improving my “OO-experience” and doing a bit of work too.
Mmm…I think that Python is a bit more widespread than Ruby, isn’t
it?

OTOH, I LOVE Python’s indentation-based
statement grouping! Oh yeah, Python’s threading is quirky on some
systems.

How Ruby group statements?

  • It supports regex’s in both an object interface (a la Python) and
    via Perl-style variables.

Very well.

  • Ruby’s object system is beautiful, elegant, and practical. It’s
    much more “pure” (in the Smalltalk definition) than either Perl or
    Python and allows you to retroactively modify pre-existing instances
    of an object at runtime by modifying their class. (See
    http://www.unr.nevada.edu/~tahammer/hack/ruby/ for an example).

I’ll take a look later. Mmm that’s wonderful. OO a la Smalltalk!

  • Its syntax contains elements of Perl’s regexps, but any perceived
    similarity to Perl’s variable system is strictly coincidental. eg:

            Perl                    Ruby
            ----                    ----
    
    var     <illegal var name>      lexical variable
    
    Var     <illegal var name>      constant lexical variabls
    
    $var    scalar variable         global variable
    
    @var    array variable          object instance variable
    
    @@var   <illegal>               class variable
    

    Any variable can hold any type of data. The format of the
    variable’s name merely dictates how it may be accessed.

Brrr! The above is one ot the reason making me avoiding Perl

My only hope is that you take Ruby for what it is, and not for what it
might resemble at a glance.

Is what I’m going to do.

···

On 11 Aug 2002 16:12:10 -0700, Tim Hammerquist tim@vegeta.ath.cx wrote:


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

LOL, you’re right. I still consider switching to it. It seems very
powerful (like Python…)

···

On Sun, 11 Aug 2002 20:33:07 +0200, Kent Dahl kentda@stud.ntnu.no wrote:

Deducting that you won’t like Ruby syntax based on not liking Perl
syntax is sort of like saying that you won’t like steak because you hate
liver. You’ll change your mind, unless you are a vegetarian :slight_smile:


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

It’s not so funny in English, because it’s a padory of an italian tv
spot. The spot claims - (Tiziana da Milano: “avevo un fidanzato, poi
è arrivato Halo”) - and - literally in English is “i had a boyfriend,
then Halo did come” and mine sign says: " i had Halo, then a girlfiend
did come ;-)"

Halo is the X-Box game

···

On Mon, 12 Aug 2002 17:57:36 GMT, “Hal E. Fulton” hal9000@hypermetrics.com wrote:

Heh, no. One semester only, long ago.
What does the quote mean?


Rhymes (rhymes@NOSPAMmyself.com)
http://www26.brinkster.com/rhymes
" avevo Halo, poi è arrivata la mia fidanzata :wink: "

Tim Hammerquist wrote:

OTOH, I LOVE Python’s indentation-based
statement grouping!

The only problem with it is editors can’t know how to indent it for you
automatically (unless you whack a “pass” at the end of every block, but
that’s silly).

dblack@candle.superlink.net graced us by uttering:

Tim Hammerquist wrote:

  • Ruby’s object system is beautiful, elegant, and practical. It’s
    much more “pure” (in the Smalltalk definition) than either Perl
    or Python and allows you to retroactively modify pre-existing
    instances of an object at runtime by modifying their class. (See
    http://www.unr.nevada.edu/~tahammer/hack/ruby/ for an example).

Or even by adding methods to the object itself:

str = "Ruby is an extraordinary language."
def str.vowels
scan(/[aeiou]/)
end
p str.vowels
=> [“u”, “i”, “a”, “e”, “a”, “o”, “i”, “a”, “a”, “u”, “a”, “e”]

Yes, but even Python can do that! :wink:

Perhaps I didn’t explain well:

What if you need a certain method on a whole bunch of pre-existing
objects. Do you want to manually add the method to each object, and
then possibly have to add it to more, later?

str = “Ruby is an extraordinary language.”

class String
def vowels
scan(/[aeiou]/)
end
end

p str.vowels
[“u”, “i”, “a”, “e”, “a”, “o”, “i”, “a”, “a”, “u”, “a”, “e”]
p FILE.vowels
[“i”]
p ENV[“PATH”].vowels
[“o”, “e”, “i”, “i”, “u”, “o”, “a”, “i”, “u”, “i”, “u”, “i”, “i”, “u”,
“i”, “a”, “a”, “i”, “u”, “a”, “e”, “i”, “u”, “a”, “e”, “o”, “i”, “o”,
“o”, “e”, “i”, “o”, “e”, “i”, “o”, “e”, “i”, “o”, “o”, “e”, “i”]

Furthermore, suppose you decide later on that you’d like #vowels to
return "y"s also. Simply redefine the method!

class String
def vowels
scan(/[aeiouy]/)
end
end

p str.vowels
[“u”, “y”, “i”, “a”, “e”, “a”, “o”, “i”, “a”, “y”, “a”, “u”, “a”, “e”]

Yes, this would be better implemented with a separate function, rather
than risk breaking existing code that expects only the 5 primary vowels.
Or add an optional boolean argument to #vowels indicating you want the
extra characters matched, etc., etc. =) However, if you absolutely MUST
modify your program at runtime, at least we know Ruby lets us…

This still doesn’t mean this functionality is desirable to you, and some
other languages might consider this a Bad Thing ™. But I’d sure hate
to need this functionality and be using a language that doesn’t provide
for it!

HTH
Tim Hammerquist

···


His ignorance is painful.
– Cell, Dragonball Z

http://www.cse.unsw.edu.au/~gjmc469/