From: Bill Kelly Date: 2002-01-24T03:18:50+09:00 Subject: Re: OOP UI Design From: "Chris Gehlker" > > On 1/23/02 8:05 AM, "James Britt (rubydev)" wrote: > > > But they *are* evil! Anyway, such phrasing helps provoke people into > > reconsidering what may be unchallenged assumptions. > > I'm actually starting to question that. (And I hate myself for it). When I > encountered ObjC's key-value coding, I was sure it was evil and I preached > jeremiads on the eminent destruction of the language and all its works. > Funny though, the gods have withheld their wrath. I not only use programs > that rely on this abomination, it has started to creep into my own code. > > I feel the same way about ruby's attr_accessor and its demon siblings. Why? In Ruby these aren't relegated to being simple getters & setters - they're compatible with the Uniform Access principle ("All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation.", see http://www.elj.com/elj/v1/n1/bm/urp/ ) That is, Ruby lets us start out with an attr_accessor for :num_monkeys in class Barrel, just getting and setting a stored value; but if computation should become necessary to the task, Ruby lets us define Barrel#num_monkeys and Barrel#num_monkeys= as methods more complex than those auto- generated by attr_accessor. . . . . . Does this address any of your concerns, or am I, like, totally missing the point? =) Regards, Bill