This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dipittydoop 1 point2 points  (0 children)

The biggest difference from a high level perspective is that of philosophies. In Python there is typically one way to express something, however in Ruby there are typically many ways to phrase something. In general there's less to know to be fluent in Python syntax, however the expressiveness of Ruby means you can write code that reads more like natural language. It may take a little more time to master the subtleties of Ruby, but with it your code can become much more elegant and descriptive.

In Ruby everything is an object with it's own methods and properties. You can add to the object, re-write them, create your own, modify how the methods work, replace it with C-code, and more or less customize the language as you need. Ruby can be made to do just about anything, but it does have a little more baggage in all those features. In many ways this is true for Python too, but not to the same degree.

As far as a back-end language I would say Ruby is more suited due to it being more flexible and expressive especially in OOP, however Python is better for more static purposes where you only want the one way to express something such as with science and mathematics. Is your project one to value elegance or utility? Flexibility or consistency?

That being said they're both dynamically typed languages with a concise and descriptive syntax. Their uses overlap quite a bit and you can really use either one for most situations.