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.