I’ve always been a little put off by the Pythonic “There Is One Right Way To Do It” ethic. It’s not just because I like Perl, with its “There Is More Than One Way To Do It”.
I’ve had discussions in the past with Pythonistas about the differences between Ruby and Python. I’ve mentioned the fact that I like the Ruby community’s attitude about how things are done, and that I don’t like the Python community’s attitude so much. I have also mentioned that (unsurprisingly) the languages reflect the communities’ attitudes as an implementation of principle — languages tend to accrete communities whose policies match the languages’ policies, after all.
Well, this first impression of Rails 1.2.1 illustrates something essential to that community and language policy of the Ruby language, something I like about it. Specifically, this bit caught my attention:
I’ve mentioned that this is what coding in Rails continually feels like: sometimes it just feels off even though it works and is nicer than other languages, and soon I realize a beautiful Right Way to do it.
In other words, the language tends to encourage elegant, “Right” ways to do things, but you don’t feel like you have a gun to your head demanding you make it happen that way. It’s like the language teaches the attentive programmer, helping him learn for himself how to program better. Python, meanwhile, (generally) just refuses to let your program run if it’s not written the way the language designers have decreed is the Right Way. At least, that’s how it feels, reading about the language, reading the occasional bit of source code, discussing its “benefits” with Pythonistas, seeing direct translations between languages, and even (horror of horrors) once in a great while editing a little Python code.
I definitely prefer something fairly open, that gently guides me toward doing something beautiful, over something that just limits what I can do to a set of “correct” actions. I guess, the way I see it, if Java is the new COBOL, Python is a bit like the new Pascal — if that helps you understand my perspective at all. (As far as I’m concerned, that’s about a 1000% improvement over being the new COBOL.)
I suppose it’s possible that, once I become truly competent with both Ruby and Python (it’ll probably happen for both eventually, though much sooner for Ruby than Python, given my druthers and my plans for the near future), I’ll discover I’m way out in left field somewhere. I have yet to run across a single bit of credible evidence to the contrary, or even a believable claim that contradicts these impressions.
Some, of course, prefer the Python way of doing things — and they’ll surely describe the comparative characteristics of the two languages differently from how I have. Python is “cleaner”, they might say, and Ruby “too much like Perl” (yeah, keep using that “insult” while proselytizing — it just drives me further from Python and closer to Ruby anyway). Meanwhile, the Rubyist might say that Ruby “encourages” and “guides”, while Python “forces” (though, frankly, in truth Ruby users always seem to be among the most open and friendly of any language’s communities, along with a couple of rare other examples, so I’m not sure your average Rubyist would say anything of the sort).
That’s fine, really. Pythonistas and I don’t have to see eye-to-eye. That’s why they’re Pythonistas and I’m not. At least you know some of the reasoning behind my preference for a language like Ruby over one like Python.
note to self: Check out the above-linked blogger’s website, NearbyGamers. Also, come up with a good, secure, private way to share bookmarks across computers automagically.