Philosophical Multicore

Sometimes controversial, sometimes fallacious, sometimes thought-provoking, and always fun.

Ruby versus Python

Posted by Michael Dickens on November 7, 2009

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.

About these ads

2 Responses to “Ruby versus Python”

  1. LRFLEW said

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

  2. phynnboi said

    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.

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

 
Follow

Get every new post delivered to your Inbox.

Join 450 other followers

%d bloggers like this: