Ruby and Python Compared

September 28, 2005 by Doug Leave a reply »

I’m a big fan of both of these languages and in my opinion they have a great future online and off. With them having a number of similarities there’s obviously going to be some quite heated debate as to which is the ‘best’. I’ve previously pointed out in one of my posts a benchmark comparison that was done between the two of them.
They both have a lot to offer the web too and as their popularity grows I can see them replacing/nudging PHP from its throne.

So to the comparison which you can find here.

He takes a very balanced view, first giving a nice intro about the philosophical differences between the two contenders and pointing out that they were born of a will to improve upon the Perl language. Some would argue otherwise but you can’t deny the Perly attributes of both.

Larry Wall, the designer of Perl, has the slogan “There’s more than one way to do it”. In contrast, Bertrand Meyer, the designer of Eiffel, says “A programming language should provide one good way of performing any operation of interest; it should avoid providing two.” Ruby follows the anarchist approach of Larry Wall, while Python follows the bondage-and- discipline approach of Eiffel. Thus Ruby provides synonyms for many operations — proc and lambda, Hash.has_key? and Hash.key?, and so forth — increasing the chances that a programmer will guess right, but decreasing the possibility that two programmers with the same task will produce the same code. Python usually seems to have one best way to perform a given task, and even prescribes how the code is to be laid out, since indentation is syntactically significant.

Whats the conclusion? Well as he points out ‘whatever fits the job’, although he points out his personal preference for power and flexibility although not when prototyping C in which case “the added power and flexibility of Ruby is undesirable”.

Read the full article on Python and Ruby compared.

UPDATE: You’ll find another good comparison here: Python & Ruby “Power”

Share and Enjoy:
  • Digg
  • del.icio.us
  • Google Bookmarks
  • BlinkList
  • DZone
  • Live
  • Ma.gnolia
  • Reddit
  • Slashdot
  • SphereIt
  • StumbleUpon

Related

Advertisement

Leave a Reply