Home > Computer Science, Programming > Ruby versus Python

Ruby versus Python

I have some experience programming in both Ruby and Python, and have long wondered which is superior. Many people love Python, and many others love Ruby. Both of them, in my opinion, are at the pinnacle of easy-to-use languages; they are both dynamically typed, multi-paradigm languages. Here is a comparison of the details, with the winner in bold.

Speed: Python is usually faster than Ruby, and sometimes a lot faster.

Intuitiveness: Ruby has many very intuitive features, but Python has a slight edge on this one.

Versatility: Python can do a lot with a little (for example, its for loop has many different uses), but Ruby can do a lot with a lot (for example, it has at least nine different loops and iterators, all of which are super cool).

Indentation Formatting: The fact that Python requires indentation makes a lot of things easier. But it also makes a lot of things harder. For example, what if I have a statement that takes up more than one line? Sure, I can make it work, but it’s annoying. Ruby is better about this. I still have a problem with Ruby, though. Don’t kill me, but . . . I like brackets better than “end” keywords. Having several nested “end” keywords is not fun to look at.

String Handling: Both languages are very good, but Ruby is better. Some people think it’s even better than Perl.

Array Handling: Ruby is easily better. Don’t get me wrong, you can do a lot with Python, but Ruby’s arrays are just amazing. Look at the specification.

Advertisements
  1. November 7, 2009 at 6:47 pm

    Did you forget to close one of the >b< tags?

  2. phynnboi
    November 9, 2009 at 3:55 pm

    I chose Python for the execution speed and because it seems to have better third-party support. Also, people often say that Ruby feels a lot like Perl, and I was trying to distance myself from Perl. You know, if I want to program in something that feels like Perl, I already know Perl.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: