From: Nat Pryce Date: 2002-11-08T00:50:19+09:00 Subject: Re: Making Instace Variables Private/Local I think Bill's point is that it would be better for instance variables to be hidden behind an interface made up of public or protected methods so that the implementation of a base class can change without breaking derived classes. And I have to agree with him. Cheers, Nat. On Thu, 2002-11-07 at 15:31, dblack@candle.superlink.net wrote: > Hi -- > > On Thu, 7 Nov 2002, William Djaja Tjokroaminata wrote: > > > If you are still considering to use '@_var' or '@__var' to create class > > private/local variables, are you open to the idea of simply making all > > instance variables private? The descendant classes then can access the > > instance variables using 'self.var', where the method 'var' can either be > > public or protected. > > Your second sentence doesn't necessarily relate to your initial > question :-) Meaning: whether instance vars are private or not, > there's no reason to think that every instance var is going to have > one of these: > > def var > @var > end > > associated with it. All sorts of other permutations are > possible... including no accessor method, or this: > > def var > @thing > end > > or this: > > def var > @var * 2 > end > > etc. > > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav > > -- Dr. Nathaniel Pryce, Technical Director, B13media Ltd. Studio 3a, 22-24 Highbury Grove, London N5 2EA, UK http://www.b13media.com