Should I Learn Python or Ruby next?

Thomas Jollans thomas at jollans.com
Tue Jun 22 06:02:18 EDT 2010


On 06/22/2010 10:58 AM, Josef Tupag wrote:
> I've been programming (when I do program) mainly in Perl
> <http://www.perl.org/> for the last 10 years or so. But I've been
> itching to learn a new language for a while now, and the two near the
> top of the list are Ruby <http://www.ruby-lang.org/> and Python
> <http://python.org/>.
> 
> I figure that Ruby would be easy to learn because of its similarity to
> Perl (I'm told). But I also figure that Python would be easy to learn
> because of its simplicity. And when it comes to webby stuff, I can use
> Rails <http://www.rubyonrails.org/> with Ruby and Django
> <http://www.djangoproject.com/> with Python.
> 
> I'm currently leaning toward Python and began doing so last week. I
> started with Mark Pilgrim's excellent Dive Into Python
> <http://diveintopython.org/> and made it thru the first 3 chapters
> pretty quickly. So far it feels pretty good.
> 
> Before I really dive in, though, I'm curious to hear what others think
> about the choice between these two languages.

Ruby has a bunch of strange syntactical zits: I mean, @instancevariable,
@@classvariable, $GLOBAL, and whatnot?? I don't like them, I find
Python's syntax cleaner, easier on the eye, and the finger.

It's all a matter of taste. You should probably look into Ruby too, at
least a bit. I can think of one single point where Python probably wins
hands-down: it comes with batteries included. The standard library is
great, and I don't think Ruby has anything like it. There are rubygems,
of course, but there is also the PyPI.

"Everything is an object" in both languages, or so they say. But what
that means is different. If you're coming from Perl 5, you probably
won't care much anyway. I personally prefer Python's [methods are
functions are objects] to Ruby's [functions are methods are
messages-to-objects]. Ah well

To get really religious, and Ruby violates quite a few of these,
>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>>


[Community!]
Ruby is almost only used on Rails and in Japan. We're much more
universal, and more friendly ! ;-)

-- Thomas

> 
> (On a related note, you might also read Tim Bray's On Ruby
> <http://www.tbray.org/ongoing/When/200x/2006/07/24/Ruby> post, since he
> just started learning Ruby.)
> 
> 
> Josef Tupag - best humidifier <http://thebesthumidifiers.com>
> 
> 




More information about the Python-list mailing list