Archive - Originally posted on "The Horse's Mouth" - 2007-10-02 20:03:23 - Graham Ellis
Ruby v Python ... I've been asked for a comparison!
• Both are object oriented scripting languages - or rather claim to be scripting languages, but are really compile-and-run via their own virtual machines, in just the same way as Perl and Java are.
• Both are modern, Open Source languages with a wide range of standard classes and methods provided as standard, and lots of other libraries available too.
• Python is a clean, minimalist language which is not cluttered with lots of alternative syntax and special characters @ and $ and the like used in conjunction with variable names, whereas Ruby uses a number of those specials to indicate variables, scope, etc. From the programmer's viewpoint, this means that Python code may be a little longer, but will be easier to read and maintain by a programmer who doesn't spend large amounts of time coding in the language.
• Ruby also provides capabilities such as topicalisation which allow the knowledgeable programmer to shorten code to the confusion of the novice maintainer. No bad thing if you have a small team of Ruby pogrammers who will be responsible for the whole life of the application, but an issue if you use other people to maintain.
• Python's typical applications can be regarded as being very wide ranging. We have trained user on all sort of applications, some (but a minority) of which are web based. Ruby is, to date, very much used in "Ruby on Rails" - a Web framework - so it tends to be very much a language that's associated with web content applications.
Which would I choose for a new project? Given the artificial choice of just these two languages, I would probably go Ruby if I was looking at a web-based content system / shopping cart / on line application, and I would go Python otherwise. But with existing code in either language, or a support team who knew one language but not the other, I would be very comfortable with either language for either type of application.