From: Austin Ziegler Date: 2004-02-26T03:09:48+09:00 Subject: Re: Need examples comparing Ruby to Python On Wed, 25 Feb 2004 10:49:49 +0900, David MacQuigg wrote: > Adding up all of the above "personal preference" pluses, they seem about > equal to the one big personal preference minus I see - the fact that Ruby > doesn't use indentation to establish structure. When I first started > using Python, I thought that was strange, then I found that I almost > never made a mistake with indentation, and when I did, the interpreter > caught it right away. The big plus is that I can now read other peoples > code and count on the indentation to mean something. What I think that you'll find is that many people who chose Ruby over Python is over this very issue. I had the choice to learn Python or Ruby. I think that syntactically significant whitespace is one of the dumbest ideas I've ever heard of, and refuse to learn Python for that very reason, even though Python and Ruby are effectively equivalent at this point from a language functionality perspective. Some people (like yourself) prefer it. I don't. And that's the main difference between Ruby and Python from my perspective. There is a logical reason for this. Often, when I'm doing "spot debugging", I'll do something like: class Foo def bar(x) p @baz @baz = x p @baz end I outdent the "p" lines because it is something that is going to go "bye-bye" when I am done with the spot-debugging. Some I'll promote to full debugging statements that become part of the official code, but that's rare. In vim, I can do /^p and find these in my files for easy deletion. Sure, there are other things that bother me more, now that I understand Python a bit more than I did when I made the initial choice. 1. Python's OO capabilities feel as unnatural as Perl's OO capabilities and just as bolted-on. 2. There's not enough consistency; things that would sensibly be methods might be functions in Python (making some of the same choices as Perl). I believe that join and map are cases for this. 3. The culture of Python -- there's "one right way" to do things -- doesn't fit what I liked about the culture of Perl. 4. The culture of Python, to me, seems less welcoming than the culture of Ruby. -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2004.02.25 * 12.52.48