Ian Bicking: the old part of his blog

re: "Why Python is better than Ruby"

I guess I'd be afraid of lots of "Ruby has that too!" responses, but I suppose if prefaced properly maybe that would be okay. Or it could just go on the Python Wiki, and let collective editing clear out the issues and debate. The Pattern Repository has a page: http://c2.com/cgi/wiki?PythonVsRuby -- but it's not that up-to-date and there's no clear distinction between exposition and discussion.

To me, most of it comes down to some vague design principles: Python emphasizes uniformity, and in this way it's much more like Smalltalk. It also has some different perspectives on how to address the same issues, e.g. loops and first class functions instead of blocks. There's also some things that I have intuitions about, but haven't tried enough in Ruby to confirm. E.g., a traditional procedural perspective makes libraries easier to wrap, and encourages two-level wrapping -- a very thin wrapper that interfaces with C, and another wrapper that provides "Pythonic" abstractions over that library. This is a design technique that I really like; I'm sure people do it in Ruby as well, but I suspect it's not as easy to do the trully thin wrapper in a strict OO world.

There's some other important design issues that I have with Ruby. One in particular is the ways you can globally effect the system, and effect the basic types in the system. Being able to implement (globally and transparently) case-insensitive comparisons of strings is an anti-feature to me. This is an aspect of Smalltalk I dislike.

But the big one for me is the libraries and infrastructure. Python has gained a considerable degree of acceptance, has become part of the standard installation of most Unixy OSes (including Mac OS X), is a first-tier target for open source libraries (there's a lot of C libraries that have Python bindings from day one), and there's a large community of people who have learned how to do interesting and novel things in Python without requiring changes (or even good support!) from the language. Twisted, for example, would have been a lot easier in Ruby, and yet they seem to be doing pretty well despite that. All the really exciting stuff in Python these days isn't in the core language, and yet there's a lot of exciting things happening.

What really discourages me from the comparison and debate is that I don't think there's much to be gained from it. For Python and Ruby to try to take users from each other is a losing game -- we're both small players, and there's much better and bigger pools of developers we should be trying to attract. There's also so much more we can say about why you should use either language instead of Java or C# or what-have-you, compared to why you should use Python instead of Ruby or vice versa.

Comment on Re: Fixes What's Wrong With Python
by Ian Bicking