View Full Version : Python or Ruby, which one to learn first?

October 3rd, 2005, 01:13 AM
Which one is best to learn first?
Python or Ruby?
-Dan Rippon

October 3rd, 2005, 01:23 AM
python has much more third party modules.

October 3rd, 2005, 01:41 AM
python has much more third party modules.

Which won't mean a darn thing to someone just picking up the basics. :)

October 3rd, 2005, 01:52 AM
You'll get many opinions as a response to this question. Mine is Python for example. But, I suggest you find a small tutorial for each and work through them. Then choose the one that feels more comfortable to you. Most of the opinions here are going to be biased towards the one the opinion holder is used to, as mine is. You won't need to invest much time in order to get the feel for either choice.
Have fun!

October 3rd, 2005, 02:40 AM
Which one is best to learn first?
Python or Ruby?
-Dan Rippon

My answer here would be Python.

But, probably the best way to decide would be to work through a small example in Python and Ruby and see which feels best.

If you have some programming experience in other languages, there's a good discussion on the language differences between Python and Ruby here:

(That discussion probably doesn't directly address the question about which one is easier to learn. But it provides insight on how both languages are designed to solve problems.)

October 3rd, 2005, 02:48 AM

I mean...cartoon foxes even.

More seriously, I agree that you should look at them both a bit to see what you like. I learned Ruby first, then python, and the whole time I was using python, I kep thinking "why is this like this? It doesn't make sense here.." and kept yearning for Ruby syntax and features.

To each their own though. Whichever one you choose, enjoy it. ;)

October 3rd, 2005, 05:37 PM
I first learned Basic, then VB and VB.NET then moved onto Python.

Python is a nice language once you get use to things (syntax that is) if you have never programmed before then i would take a look at Non-Programmers Tutorial For Python (http://honors.montana.edu/~jjc/easytut/easytut/easytut.html) its a nice fun intro into python which gives you tasks at the end of some chapters, there is just enough there to keep the intrest and taste for python there while you learn some of the basics. Ive never tryed Ruby as i've found python will do every thing i have ever wanted to know/do. But like the other guys have said take a look at both and see which you like enjoy and understand the most :)

October 3rd, 2005, 06:18 PM
A reason to choose python is that it is the language of choice for most things ubuntu-related.

October 3rd, 2005, 06:20 PM
Python. read Byte of python.

October 5th, 2005, 12:41 PM
Ruby is both more pure (as far as OO goes) and idealistic. I don't want to start a flamewar here, but as far as the language goes, Ruby has more going for it than Python. It will be easier to learn as it's more consistent.

Python has more code written for it though. That means more third party libs you can use. It's also probably faster than Ruby, and certainly implemented better.

October 5th, 2005, 01:45 PM
Another vote for python.

I've had a real brief look at ruby but got turned off by the warts (just my personal preference).

October 5th, 2005, 01:46 PM

October 5th, 2005, 07:20 PM
Python, for the win.

I simply can't stand Ruby's stance of "pure OO-ness." OO is great, but I don't see why it has to be applied everywhere and forced upon you. I've tried many times to learn Ruby, but this is always an obstacle in my learning.

October 6th, 2005, 03:07 AM
It is not forced. I write "structured" ruby often.

Feel free to bash it needlessly though. I will just be playing with my 'ruby ball' happily in the corner. :)

October 6th, 2005, 04:19 AM
Python, for the win.

I simply can't stand Ruby's stance of "pure OO-ness." OO is great, but I don't see why it has to be applied everywhere and forced upon you. I've tried many times to learn Ruby, but this is always an obstacle in my learning.

I don't feel that OO is forced on you in Ruby. Both Ruby and Python are equally OO.

From the article I linked earlier in this thread:

Object Oriented Programming

Sometimes Ruby is called "more OO" than Python. I don't think this has much basis.

Both languages are better understood as message-passing than class-based OO. That is, instead of being focused on types and classes, you have "objects" and you ask those objects for things. Classes are an implementation detail. This is a typical feature of dynamically typed systems, and an important basis for metaprogramming.

What you ask objects for is different in the two languages. In Ruby you ask objects to do something. There are no exposed attributes, just methods. Some Python programmers get in a tizzy because functions are not first-class in Ruby (there is no functions, just messages called "methods"). This isn't really fair -- the basic concept (deferred execution) is present in the form of blocks.

In Python you ask an object for attributes, and those attributes may be bound functions. Though the perspectives are different, the functionality is ultimately the same.

In both languages everything is an object.

Ruby's syntax seems more consistant than Python's. However, most programmers who learn Python first tend not to like Ruby's syntax very much. It doesn't mean that Ruby is an awkward language, it just means that we like/love Python more.

October 6th, 2005, 06:53 PM
I love Ruby, and I prefer it over Python. It's younger, so it benefits from experience of both Perl and Python. It is pure object, and give more freedom to the developer.

But I have to recognize that Python is more popular. It is used to script different type of applications, and will be used by more.

So... If you just want to program, Ruby would be more fun. If you want to contribute soon to Ubuntu or other major projects, Python would be more useful.

October 6th, 2005, 07:36 PM
Which one is best to learn first?
Python or Ruby?
-Dan Rippon

I'm not going to go down the "which is better/best/133t35+" path with this, as such is moot and open for bashing w/o having proper context.

I program in both, plus Java, Perl, Tcl/Tk and on the rare occasion when the gods smile down upon me, Smalltalk. I was raised on assembler and Fortran (Dad's a programmer too) and wasted a better part of $100k US on an education in C/C++ that I promptly abandoned for Java. Suffice it to say I have a fairly decent breadth of experience in programming languages.

I'll now stop tooting my own horn and get on to your question...

It really depends on what you want to do once you get past the basics with either language.

1) Python - if you want to write pyGTK apps for GNOME Desktop and Ubunutu/Linux then Python is the way to go.

2) Ruby - if you want to learn how to develop web applications (using the Rails framework and MySQL or some other DB) then I'd definitely recommend Ruby. There are a good number of C/C++ library binding kits for Ruby, but not nearly on the level or completeness of Python.

3) Learn Both (!) - Pick one of them and spend some time getting comfortable with the syntax and programming methods and then switch and learn the other. Comparative language experience is a good way of understanding how some languages are better than others for solving particular problems... and it makes you look cool to your geek peers. ;)

Recommended reading:
O'reilly's "Learning Python, 2nd Edition"
O'reilly's "Python in a Nutshell"

Pragmatic Bookshelf's "Programming Ruby: The Pragmatic Programmers' Guide, 2nd Edition"
Pragmatic Bookshelf's "Agile Web Development with Rails" (if you want to learn web development with Ruby)

Hope this helps!


Luke Redpath
October 6th, 2005, 11:58 PM
Good reply Etienne. Personally, I prefer Ruby, but because everybody is going to have their own opinions, the best thing to do is try both out and see what you prefer. And if you like both, learn both, time permitting.

October 7th, 2005, 05:14 PM
Ruby got my attention for a while, but python finally got me...

Hey, neither of both languages is better than the other (for the moment)
So, just get your hands on something, and dont be afraid to change to another language later, go and "fetch" the one that WILL MAKE YOU MORE HAPPY, and productive $$$ :cool:

October 7th, 2005, 06:24 PM
Like I sad I like python very much and I hate beacuse my high school is so old-school . We have to learn Java

They have listed us some reasons choosing java. And its totally same than with python. + python is free as in speech :)


October 8th, 2005, 03:51 AM
If you learn Python first, Ruby will come much easier. I'm not so sure the same can be said of the reverse.