From: Chad Perrin Date: 2007-05-23T07:23:21+09:00 Subject: Re: How to adopt "Python Style" indentation for Ruby On Wed, May 23, 2007 at 04:28:45AM +0900, Eric Mahurin wrote: > On 5/22/07, Brad Phelan wrote: > >I am not concerned really either way with the indentation thingie. I > >don't think that is the main difference between python and Ruby. In my > >op' the fact that Python does not do generic blocks is the main arguing > >point. I am not sure why the indentation issue raises so much heat. > > Agreed. Indentation vs. other ways of delimiting code blocks is just > a surface issue. For the most part, it is just a preference thing. That's why it draws so much heat: it's a preference thing. People foo don't like finding a language that suits their preferences, getting into it and really getting familiar with it, then having someone bar come from another language's norms to start suggesting it should be changed to suit their (foo's) preferences less well. Meanwhile, other people bar who find a language that suits their preferences really well start wanting to go around to all other languages they use and start recommending those languages be modified to suit their preferences, regardless of the fact that these other languages probably suit the preferences of other people foo who already use them. It relates to the fact that everyone wants to believe his or her preferences are "right" and others' are "wrong". The term "religious war" or "holy war" in relation to programming languages, vi/emacs/VisualStudio, et cetera, is disturbingly appropriate because of the root psychological causes in common between these arguments over preferences and those over religious observance preferences, I think. > > The lack of a real lambda (and its verbose syntax compared to ruby > blocks) in python is a much bigger issue. I still think python's > crippling of the lambda has to do with the indentation thing. The way > they did it, indented code blocks ("suites") are only part of > statements (not more generic expressions). Since a lambda is an > expression (probably used in an enclosing statment), it doesn't get to > have generic code blocks. With some rework, blocks delimited by > indentation don't have to be so limited. I remember reading that Guido just flat-out stated once that lambdas would never be allowed to have more than one line, as though he simply felt that multi-line lambdas were "bad" somehow. I don't know if the reasoning you suggest might have been behind it, but the way I read it, it seemed like Guido is interested in mandating certain restrictions to enforce his ideas of good programming practice. The assumption there would be that he believes multi-line lambdas interfere with some aspect of good programming practice -- probably something to do with human readability. He might also simply want to discourage people from using lambdas where objects "should" be used instead. I could just be misinterpreting the motivation, of course. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] Thomas McCauley: "The measure of a man's real character is what he would do if he knew he would never be found out."