From: Trans Date: 2008-03-31T10:29:54+09:00 Subject: Re: instance variable access Hi-- On Mar 30, 11:04 am, "Rick DeNatale" wrote: > On Sun, Mar 30, 2008 at 10:09 AM, Robert Dober wrote: > > On Sun, Mar 30, 2008 at 1:05 PM, Trans wrote: > > Basically I like the idea. > > I don't. > > This sort of thing encourages thinking about objects as data > structures rather than objects and discourages good OO implementation > practices such as "Tell don't ask". > > Just because instance_variable_get and instance_variable_set are > there, kind of like a fire extinguisher behind a glass door, doesn't > mean that their use should be encouraged, or that magic hammers to > break the glass without thinking about the consequences are a good > idea. The intent is not to encourage meta-programming when meta-programming should not be used. But only to better facilitate it when it is used. In fact, a general tactic of Ruby is to use long names or __shadow_methods__ for such things as a form of discouragement (perhaps a silly practice but there it is nonetheless). What I propose here keeps in toe with that since it requires an additional decorative layer to gain access to the instance variables. T.