From: Joel VanderWerf Date: 2007-05-23T01:38:28+09:00 Subject: Re: How to adopt "Python Style" indentation for Ruby M. Edward (Ed) Borasky wrote: ... > But I want a *blue* bike shed next to *my* nuclear power plant. Coming soon from the Pragmatic Programmers: "What Color is Your Bike Shed?" (Chapter 1: Why Ruby Syntax Sucks; previews are available on ruby-talk.) > Anyhow, here's a couple of examples of things pretty much "standard > Ruby" that I still find confusing coming from other descendants of Algol > 60 syntax: > > 1. attribute_accessor :person > > self.person = "Ed" > > I really want it to be "attribute_accessor person" -- the constant > mixing of the same name with and without a preceding colon in Ruby is as > confusing to me as Perl's "$hash{'key'}" referring to an entry in > "%hash" vs. another variable entirely called "$hash". I can understand that being confusing at first, if you've never used an expression-based language, but once you have seen code in which the argument is evaluated from some nontrivial expression (or called from some other class method), you should find it not at all strange, but rather like an old friend. attr_accessor(*File.read("attr_list").split) It starts getting confusing again when you have to remember that the alias keyword _doesn't_ work this way (but Module#alias_method does). -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407