Python and Ruby
Alex Martelli <aleaxit-/[email protected]> Fri, 5 Mar 2004 09:31:11 +0100
| Newsgroups | gmane.comp.python.marketing.general |
|---|---|
| Organization | None in Sight |
| Message-ID | <[email protected]> |
Indeed, I still essentially endorse Michael's summary of my views...: > **Alex Martelli calls it a wash** > > Alex provides a side by side comparison of the features of Ruby and Python > in a posting to the comp.lang.python mailing list > http://groups.google.com/groups?selm=bhqr78021hp%40enews1.newsguy.com. He > concludes that the langauges are very much alike and that most differences > are only cosmetic. His one exception to this observation is seen in the > following quote from the message: > > """ Ruby "goes to eleven" in this regard (the reference here is to "Spinal > Tap", of course). In Ruby, there are no limits to my creativity -- if I > decide that all string comparisons must become case-insensitive, _I CAN DO > THAT_! i.e., I can dynamically alter the built-in string class so that > > a = "Hello World" > b = "hello world" > if a == b > print "equal!\n" > else > print "different!\n" > end > > WILL print "equal". In python, there is NO way I can do that. """ > > He sees this as """a crucial issue -- one that makes Ruby much more > suitable for "tinkering", BUT Python equally more suitable for use in large > production applications. """ Definitely. Being able to make this == satisfied is self-evidently more satisfactory for sheer tinkering power. Conversely, when I'm reading a program, advising on it, maintaining it, etc, knowing that ANYTHING, even the result of an == comparison between objects of built-in types, might have been "customized", is a productivity loss. Python is highly dynamic _BUT_ it has some bedrock underneath -- the semantics of built-in types are hardwired; in Ruby, there is no such bedrock -- it's shifting sands all the way down:-). Great for tinkering, not so great for productive team-programming...! No need to present either side NEGATIVELY, mind you: they just make the two languages most attuned and suitable for somewhat different targets! A similar take can be endorsed on the "maturity" issue. There is no need to be negative on Ruby: it's an issue of "horses for courses". If your key motivations are to "leave your mark", to make a major contribution, Ruby is still young enough, under-supplied with extensions, tools, add-ons etc, to make this substantially more feasible than it would be for Python. For exactly the same reason, Python is a better choice if your key motivations are not to enhance and enrich the language and its supporting environment, but rather to use them as tools for the purpose of developing applications -- particularly large applications, requiring teams of developers and/or wide use of third-party extensiosn, frameworks, tools, and add-ons. You could say much the same for, e.g., the availability of _books_. O'Reilly and other publishers already offer an excellent array of books for and about Python -- I'm not saying the market is entirely "saturated", mind you (anything but!), but surely finding a niche where you could write a "killer book" is made harder by this rich existing offer. Ruby's nowhere as well-supplied with literature. So, if you're looking for an opportunity to WRITE books, Ruby may offer you better chances. Conversely, if you're interested in READING books, Python is the one with better prospects, for exactly the same reasons. There are two sides to every such issue, and every time I'm asked to compare Python and Ruby I try to present both sides fairly! Alex