Why did you switch from Python to Ruby?

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?

Motive for my question: I am language / platform shopping and comparing the
pros and cons of Python, C#, and anything that comes up on the radar in the
course of it. A lot of people who know about Python seem to know about
Ruby. Someone in comp.lang.python suggested that I should ask this
particular question here to get more complete opinions. The c.l.p people
are mostly happy with Python and see few if any advantages to Ruby, although
there is some discussion and dissention.

···


Cheers, www.3DProgrammer.com
Brandon Van Every Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.

Brandon,

I’ve switched from Python for two reasons:

  1. Better objects.

Pythons objects lack access control. They seem to be
designed for namespacing convenience rather than using
a true OO approach.

  1. Perl Emulation

Despite being true OO, Ruby does an amazing job of
emulating Perl.

I was using Perl for munging data quickly. Now I only
have to use Ruby.

— “Brandon J. Van Every”
vanevery@3DProgrammer.com wrote: > This question is
only meant to apply to people who

···

used to use Python, but
switched to Ruby. Why did you do so?

Motive for my question: I am language / platform
shopping and comparing the
pros and cons of Python, C#, and anything that comes
up on the radar in the
course of it. A lot of people who know about Python
seem to know about
Ruby. Someone in comp.lang.python suggested that I
should ask this
particular question here to get more complete
opinions. The c.l.p people
are mostly happy with Python and see few if any
advantages to Ruby, although
there is some discussion and dissention.


Cheers, www.3DProgrammer.com
Brandon Van Every Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

I got sick of indents, its a pain when copying and pasting code… but
real programmers never do that…

I loved ruby OO EVERYTHING is an object

Loved the iterators [1,2,3,4].each{|e| do_somthing(e) }

Sockets are nice and easy. Python is hardly and abstraction above the C
api for sockets.

Ruby C(++) extensions are A LOT nicer than python.

Ruby built in regex are nice ie. “abc” =~ /b/
/b/ is an object!

Ruby is much faster for quick throw away scripts.

Ruby has lots of the perl features without all the cr** such as $_,$1,$2

Threads are easy to implement.

···

On Tue, 2003-08-19 at 19:03, Brandon J. Van Every wrote:

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?

Motive for my question: I am language / platform shopping and comparing the
pros and cons of Python, C#, and anything that comes up on the radar in the
course of it. A lot of people who know about Python seem to know about
Ruby. Someone in comp.lang.python suggested that I should ask this
particular question here to get more complete opinions. The c.l.p people
are mostly happy with Python and see few if any advantages to Ruby, although
there is some discussion and dissention.

Closures + iterators + blocks.

Being a scheme/lisp fan, every time I had to create
temporary array to store the results of looping over another
in Python, I felt a bit nauseous. (Perhaps there’s a better
way of doing this is more recent Python versions, but I
didn’t know about it.) So I set out to find a language that
was Python-like but supported proper closures and lambda
functions. I’d only heard the name Ruby, but I thought it
might have these features – and it did!

William

···

On Tue, Aug 19, 2003 at 04:03:15PM +0900, Brandon J. Van Every wrote:

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?

Brandon J. Van Every wrote:

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?

I will assume that you’ll get answers from other readers of
comp.lang.ruby about the merits of Ruby versus Python, and I’d probably
second most of those comments, so I won’t rehash them here.

I was probably vaguely aware of Ruby for some time, but decided to take
a serious look at it when the Pragmatic Programmers (Dave Thomas and
Andy Hunt) started writing articles, and eventually a book, about
programming with Ruby. Like a lot of software developers, I was already
a big fan of their first book (The Pragmatic Programmer) and so their
endorsement of Ruby was significant to me, enough so to invest some time
in learning more about it.

That alone, however, would not have been enough. As I’ve noted
elsewhere, if you just pit Ruby and Python against each other in a
“feature list shootout”, it’s probably a tie.

The thing that really sold me, and something that a lot of long-time
Ruby users probably take for granted, is the open and generally helpful
spirit of the Ruby community. When you ask a question here, you’re as
likely as not to get an answer from Matz (the “father of Ruby”), or many
of the other resident experts in the language. We generally don’t flame
newbies, or people who ask questions like “Why did you switch from
Python to Ruby”? The support community behind a programming language (or
I guess any other activity) is something that I think you can’t ignore,
although it’s easy to do so :wink:

Anyways, that’s my $0.02.

– Lyle

“Brandon J. Van Every” vanevery@3DProgrammer.com wrote in message news:bhsguv$2l23q$1@ID-203719.news.uni-berlin.de

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?

Motive for my question: I am language / platform shopping and comparing the
pros and cons of Python, C#, and anything that comes up on the radar in the
course of it. A lot of people who know about Python seem to know about
Ruby. Someone in comp.lang.python suggested that I should ask this
particular question here to get more complete opinions. The c.l.p people
are mostly happy with Python and see few if any advantages to Ruby, although
there is some discussion and dissention.

Im far from an expert at either language; in fact, Im still learning
them side-by-side, however…

When ever I’m tinkering with a new problem, I almost always end up
using Ruby.

From a practical mindset, Python wins. Its a much better ‘environment’
to tackle programming problems with.
By that I mean that it has much more available as far as modules,
extensions,
and the like. ‘twisted’, and ‘Pygame’, and ‘Zope’ come to mind.
Its very scalable due to the fact that a coding style was built into
the language. Lots of people have problems with the forced indentation
but its there for a reason, and you get used to it. It makes code
very easy to read months down the line, and it doesnt really matter
who the past coders were, because everyone is forced into a particular
style.
Also, Python seems to be very straight-laced as far as syntax goes.
recoil entirely from the thought of any sort of code obfuscation.
There is no Python ‘golf’ it seems.

Having said all that it sounds like I’m an advocate for Python.
But…
I seem to smile alot more when using Ruby.
I can do things with less code most times, with less of a fight.
By that I mean, I can implement one of my hair-brained schemes with
a little tinkering that most times Python will simply balk at.
Like Perl there is ‘more than one way to do it’. Unlike Perl, theres
no
pain in doing so, and you can actually understand your own code a
couple of weeks down the line.
Iterators, blocks, procs, and closures are a plus too.

Some of you might say its because I’m more proficient at using Ruby
than Python, but that simply not the case. I set out to learn them
in paralel, so the proficiency/knowledge level is about the same.
I suggest that you try the same approach. Learn both at the same
time, and see what is better for you.

This is just what my experience has been.
I know its not choke full of technical reasons why you should choose
one over the other.
On the surface it seems as if Ruby doesnt offer anything extraordinary
enough to warrant a switch from Python for most users.
Its one of those things that you have to experience I think, for
it to hit you.
I would urge you to give it a whirl.
Sometimes it comes down to the intangibles in life.

···

From my limited dealings with the Python community, they seem to

I may not be the best qualified to answer this, because I looked at
Python, scowled, and ran before I got to do any serious programming, but
I have an interesting question you can ask yourself:

How many posts can you find on Google/Groups (Usenet) from people
stating they used to program in Ruby and switched to something else?

I would wager you will find zero. This isn’t just pro-Ruby FUD, either,
I have a point to make. Everyone has a reason for plugging their
favorite language, and you will find arguments for every programming
language on the face of the earth, even the worst of the worst. So,
perhaps instead of basing your decision on the presentation of what
people have to say (who may not have the charisma to convince you and
you will run off with the wrong language), try looking around and
finding who left what languages for what reasons and weigh that information.

My point here is, I have yet to hear of a single person who left Ruby
for another scripting language.

I’m sure people have left Ruby for certain pragmatic reasons (“my job
requires me to write in Perl” or “Ruby just isn’t as fast as assembly”),
but I have trouble imagining even one person leaving Ruby because it
wasn’t a good enough script language for them. You can find people who
never tried it, or tried it for a day and missed their old language
Perl/Python/Bash/Basic so much they had to go back, but I doubt you can
find any Ruby-expatriates among the group of people who have given it a
solid try.

Go Google for people who left Ruby and count them and enumerate their
reasons, if any. Ponder that for awhile.

Sean O'Dell

Brandon J. Van Every wrote:

···

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?

Motive for my question: I am language / platform shopping and comparing the
pros and cons of Python, C#, and anything that comes up on the radar in the
course of it. A lot of people who know about Python seem to know about
Ruby. Someone in comp.lang.python suggested that I should ask this
particular question here to get more complete opinions. The c.l.p people
are mostly happy with Python and see few if any advantages to Ruby, although
there is some discussion and dissention.

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?

I understand Python has improved significantly since my
experiences with it. My “Python Essential Reference” book
was based on Python 1.5.2. I learned Python at work, in
parallel with Ruby at home.

We were all learning Python together, at work. We were
writing Java apps, but wanted something higher level to
program in, so Jython (nee JPython) seemed the thing.
(No JRuby was available at the time.)

Python was so much more fun than Java that I embraced it
wholeheartedly. (Putting aside my/our misgivings about the
syntactically-significant whitespace thing.) [I tried to persuade others on my team that _anything_ had to be better than Java… They were less dissatisfied with Java’s expressive power at that time than I was…]

Ultimately Python served us well. But there were so many
times we’d try to figure out how to do something in Python
that either turned out to be impossible or inelegant, that
it became a running joke. We’d just turn to one another
sadly, and in commiseration proclaim, “Guido!”. (Perhaps
a little like “Newman!” is said on Seinfeld.)

. . . Wish I could remember more of what those things were.
Maybe they’re addressed in Python by now. One, for instance,
was when we tried to figure out how to create class methods
(as opposed to instance methods.) Page 64 of the Python
Essential Reference admits, “… it’s not possible to define
class methods that don’t operate on instances.” …Guido!!
The other I recall was trying to figure out how to do an
assignment within a conditional. The code I wanted to
write was something like:

        if (val = gd.get('startTag')):
            attrs = parseAttrs(gd['allAttrs'])
            self.handleStartTag(val.lower(), attrs)
        elif (val = gd.get('endTag')):
            self.handleEndTag(val.lower())
        elif (val = gd.get('text')):
            self.handleNonTagText(val)
        elif (val = gd.get('comment')):

            #...etc.

Apparently this was impossible. At least, I never was able
to figure out any way of doing it. I ended up with some
annoying, verbose, nested thing like:

        val = gd.get('startTag')
        if val is not None:
            attrs = parseAttrs(gd['allAttrs'])
            self.handleStartTag(val.lower(), attrs)
        else:
            val = gd.get('endTag')
            if val is not None:
                self.handleEndTag(val.lower())
            else:
                val = gd.get('text')
                if val is not None:
                    self.handleNonTagText(val)
                else:
                    val = gd.get('comment')
                    if val is not None:
                        #...etc.

…Guido!!

Another silly example might be the interactive Python
interpreter. It goes through the trouble of recognizing that
when someone says ‘exit’ they probably want to exit. But instead
of doing what the user intended, it merely spits out a complaint
that one should “Use Ctrl-D (i.e. EOF) to exit.”

…Guido!!!

My impression was that Python’s designer was trying to achieve
elegance by fiat.

My experiences with Ruby were, truly, quite the opposite.
The surprises were so pleasant: I used to laugh out loud
after awhile when I’d look up in Programming Ruby how to
do some particular thing (create a class method, say) and
find that whatever-it-was was exactly what I would have
written had I just guessed and tried it. This happened
over and over and over. So many times, I couldn’t believe
it. It became a positive running joke, of sorts, with
me.

Anyway, … it’s all so subjective. But Ruby “rubs me
the right way”… and Python didn’t. Although, Python is
still way more fun to program in than Java!

Hope this helps / for whatever it’s worth / etc…

Regards,

Bill

“Brandon J. Van Every” vanevery@3DProgrammer.com writes:

This question is only meant to apply to people who used to use Python, but
switched to Ruby. Why did you do so?
Well my way is a bit longer I first have looked at Perl but never
could get wrap my head around it, than Python (just “hobby” level) but
than found Ruby and that’s it. Ruby feels “right” for me as an object
oriented scripting language and is IMHO very simular to Eiffel which I
used for programming a long time.

Now I’m working on Ruby related stuff and have discovered Common
Lisp. Which I really like too.

Regards
Friedrich

gt wrote:
[snip]

This is just what my experience has been.
I know its not choke full of technical reasons why you should choose
one over the other.
On the surface it seems as if Ruby doesnt offer anything extraordinary
enough to warrant a switch from Python for most users.
Its one of those things that you have to experience I think, for
it to hit you.
I would urge you to give it a whirl.
Sometimes it comes down to the intangibles in life.

This is what I would call the “gestalt” of ruby!

From the Merriam-Webster Dictionary:

gestalt : a structure, configuration, or pattern
of physical, biological, or psychological
phenomena so integrated as to constitute a
functional unit with properties not derivable
by summation of its parts.

Curt

I didn’t do the google search but I know of two people who have been on this
list and have left for other languages/environments:

one to Squeak
one to O’Caml

While Ruby is wonderful to program in, it is not the end-all, be-all for all
people and all projects.

Steve Tuckner

···

-----Original Message-----
From: Sean O’Dell [mailto:sean@cSePlsoAfMt.com [REMOVE_THE_SPAM]]
Sent: Tuesday, August 19, 2003 12:04 PM
To: ruby-talk@ruby-lang.org
Subject: Re: Why did you switch from Python to Ruby?

I may not be the best qualified to answer this, because I looked at
Python, scowled, and ran before I got to do any serious
programming, but

I have an interesting question you can ask yourself:

How many posts can you find on Google/Groups (Usenet) from people
stating they used to program in Ruby and switched to something else?

I would wager you will find zero. This isn’t just pro-Ruby
FUD, either,

I have a point to make. Everyone has a reason for plugging their
favorite language, and you will find arguments for every programming
language on the face of the earth, even the worst of the worst. So,
perhaps instead of basing your decision on the presentation of what
people have to say (who may not have the charisma to convince you and
you will run off with the wrong language), try looking around and
finding who left what languages for what reasons and weigh that
information.

My point here is, I have yet to hear of a single person who left Ruby
for another scripting language.

I’m sure people have left Ruby for certain pragmatic reasons (“my job
requires me to write in Perl” or “Ruby just isn’t as fast as
assembly”),

but I have trouble imagining even one person leaving Ruby because it
wasn’t a good enough script language for them. You can find
people who
never tried it, or tried it for a day and missed their old language
Perl/Python/Bash/Basic so much they had to go back, but I
doubt you can
find any Ruby-expatriates among the group of people who have
given it a
solid try.

Go Google for people who left Ruby and count them and enumerate their
reasons, if any. Ponder that for awhile.

Sean O’Dell

Brandon J. Van Every wrote:

This question is only meant to apply to people who used to
use Python,
but
switched to Ruby. Why did you do so?

Motive for my question: I am language / platform shopping and
comparing the
pros and cons of Python, C#, and anything that comes up on the radar
in the
course of it. A lot of people who know about Python seem to know
about
Ruby. Someone in comp.lang.python suggested that I should ask this
particular question here to get more complete opinions. The c.l.p
people
are mostly happy with Python and see few if any advantages to Ruby,
although
there is some discussion and dissention.

zero has left Ruby, exellent point!

I will use this as an argument when I advertise for Ruby in the future.

···

On Tue, 19 Aug 2003 17:47:32 +0000, Sean O’Dell wrote:

How many posts can you find on Google/Groups (Usenet) from people
stating they used to program in Ruby and switched to something else?


Simon Strandgaard

In article Ews0b.2919$pl5.1575@newssvr27.news.prodigy.com,

···

Sean O’Dell <sean@cSePlsoAfMt.com[REMOVE_THE_SPAM]> wrote:

My point here is, I have yet to hear of a single person who left Ruby
for another scripting language.

To be fair, I know of two people (Ada fans) who stopped using Ruby and
switched to Python because they had problems with threads and Pgsql
connections.

Hasn’t stopped me though :slight_smile:

Interesting google challenge, if nothing else :slight_smile: Tried briefly, did come
across the following gem:

To summarize:
Python’s site says “You’ve come to our website, I bet you’d like to
try out our language. Learn a little about it, and try it at home!”
Ruby’s site says “You’ve come to our website, you probably want to
compile the latest version or see the CVS tree. No? Sorry,
please instead try our Downloads and Documents!”
Perl’s site says “Buy our T-Shirts! And follow this link to some
crufty Unix-centric hyper-super-dupertext documents! Buy both
O’Reilly books and enter to win a FREE SGI workstation!”

-- http://tinyurl.com/kixq

martin

···

Sean O’Dell <sean@cseplsoafmt.com[remove_the_spam]> wrote:

How many posts can you find on Google/Groups (Usenet) from people
stating they used to program in Ruby and switched to something else?

Lyle Johnson wrote:

The thing that really sold me, and something that a lot of long-time
Ruby users probably take for granted, is the open and generally
helpful spirit of the Ruby community.

Interesting. I hope it lasts as you get bigger… the niceness may only be
a feature of your current size. There are plenty of nice people in
comp.lang.python… but also people who will flame you for not asking
questions “the right way.” My strategy has been to killfile the latter.
Once this is done, I think c.l.p becomes a nice community to work with
again. In essence, it has been made smaller. :slight_smile:

···


Cheers, www.3DProgrammer.com
Brandon Van Every Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.

Sean O’Dell wrote:

My point here is, I have yet to hear of a single person who left Ruby
for another scripting language.

But… what does it prove? It doesn’t prove that Ruby is the reason. It
could be, that people who find out about Ruby in the 1st place, have the
developmental luxury to try languages such as Ruby. And not the production
pressure to abandon them for something else. Industrial relevance was
another question I was going to ask later, if need be, but you have
precipitated it.

I’m sure people have left Ruby for certain pragmatic reasons (“my job
requires me to write in Perl” or “Ruby just isn’t as fast as assembly”),
but I have trouble imagining even one person leaving Ruby because it
wasn’t a good enough script language for them.

On the subject of pragmatism, you are echoing my thinking. I am curious why
you think such pragmatic concerns “don’t count.” Nobody has left Ruby…
except those who have left Ruby?

but I doubt you can find any Ruby-expatriates among the group of people
who have given it a solid try.

Ok, that’s a more nuanced statement. I don’t feel like chasing all over
Google for such answers, as I seriously doubt they are findable that way.
Rather, I’ll stick a wet finger in the air and ask a question. Pythonistas
go to Ruby Heaven when they die. :slight_smile: Where do Rubicons go?

I guess your answer is, “they live forever.” But maybe others have a
different idea.

···


Cheers, www.3DProgrammer.com
Brandon Van Every Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.

Sean O’Dell <sean@cSePlsoAfMt.com[REMOVE_THE_SPAM]> wrote in message news:Ews0b.2919$pl5.1575@newssvr27.news.prodigy.com

I may not be the best qualified to answer this, because I looked at
Python, scowled, and ran before I got to do any serious programming, but
I have an interesting question you can ask yourself:

How many posts can you find on Google/Groups (Usenet) from people
stating they used to program in Ruby and switched to something else?

I would wager you will find zero. This isn’t just pro-Ruby FUD, either,
I have a point to make. Everyone has a reason for plugging their
favorite language, and you will find arguments for every programming
language on the face of the earth, even the worst of the worst. So,
perhaps instead of basing your decision on the presentation of what
people have to say (who may not have the charisma to convince you and
you will run off with the wrong language), try looking around and
finding who left what languages for what reasons and weigh that information.

My point here is, I have yet to hear of a single person who left Ruby
for another scripting language.

I’m sure people have left Ruby for certain pragmatic reasons (“my job
requires me to write in Perl” or “Ruby just isn’t as fast as assembly”),
but I have trouble imagining even one person leaving Ruby because it
wasn’t a good enough script language for them. You can find people who
never tried it, or tried it for a day and missed their old language
Perl/Python/Bash/Basic so much they had to go back, but I doubt you can
find any Ruby-expatriates among the group of people who have given it a
solid try.

Go Google for people who left Ruby and count them and enumerate their
reasons, if any. Ponder that for awhile.

Sean O’Dell

Brandon J. Van Every wrote:

Ironically, Google makes use of Python.

Which reminds me that I would like to see a discussion
on the reasons for not using ruby more for cgi and web page
generation. I’ve seen a couple of “ruby” sites that
use php. Perhaps only due to web-hosting services refusing
to implement it.
But thats a story for a different thread.

···

This question is only meant to apply to people who used to use Python, but

Sean O’Dell <sean@cSePlsoAfMt.com[REMOVE_THE_SPAM]> wrote in message news:Ews0b.2919$pl5.1575@newssvr27.news.prodigy.com

How many posts can you find on Google/Groups (Usenet) from people
stating they used to program in Ruby and switched to something else?

Okay. Suppose I propose a langauge called ‘foo’ to you, right here.
How many people do you know that used to program in ‘foo’ and switched
to something else? Does that make ‘foo’ the best language around?

Well, of course people do use Ruby. But Python and Perl are better known
scripting languages, so mostly people start with Python or Perl, then
hear about Ruby and change to it only if it seems good. The likelyhood
of someone starting with Ruby and then switching to something is
just extremely low. Parly because Ruby is good, but mostly because
people tend to learn Ruby after, not before the other languages.

try looking around and finding who left what languages for
what reasons and weigh that information.

Most people who dislike Ruby, don’t leave it: They just choose
not to even start with it. That’s the significant part you left
out from your reasoning.

Ged Byrne gedb01@yahoo.co.uk wrote in message news:20030819090212.52769.qmail@web10807.mail.yahoo.com

Brandon,

I’ve switched from Python for two reasons:

  1. Better objects.

Pythons objects lack access control. They seem to be
designed for namespacing convenience rather than using
a true OO approach.

Seems like you forgot inheritance, metaclasses, polymorphism
and object instantiation (at least) - Objects in Python are hardly
just namespaces. Access control in Python is done by letting
the name of the variable tell if it’s private and trusting
that the people coding are adults who won’t go touching
other’s privates just because it’s possible. I wonder how
this is such an inferior approach.

Sean O’Dell wrote:

I’m sure people have left Ruby for certain pragmatic reasons (“my job
requires me to write in Perl” or “Ruby just isn’t as fast as assembly”),
but I have trouble imagining even one person leaving Ruby because it
wasn’t a good enough script language for them. You can find people who
never tried it, or tried it for a day and missed their old language
Perl/Python/Bash/Basic so much they had to go back, but I doubt you can
find any Ruby-expatriates among the group of people who have given it a
solid try.

Not true, see http://www.ruby-talk.org/39308 . Compare with the authors
of http://raa.ruby-lang.org/list.rhtml?name=aspectr . Writing AspectR is
probably much more then “a solid try”.

Tobias