From: Bill Kelly Date: 2002-08-10T04:45:59+09:00 Subject: Re: ambiguity between local variable assignment and writter method From: "Hal E. Fulton" > > From: "Tom Sawyer" > > > unfortunately, this is actually bad form. if a class instance variable > > is set up to be accessed via accessor methods, they should be used at > > all times. even internally. while, it is functionally equal for the > > simplist case, writter methods may do other things as well, like > > validate the argument. > > I can't agree with that. > > Surely a class is allowed to reference its own > member data as it chooses. If it bypasses some > kind of needed extra work in the setter, that's > simply a bug in the code. And how do bugs like this ever get in the code? By people not taking steps to try to avoid the possibility of their ever occurring in the first place. :) I'm not trying to argue absolutes about good form / bad form here though - but in my own code on this issue I tend to find myself in line with Tom Sawyer, in that I try hard to set things up to minimize the possibility I can screw things up later. :) > If anything has the right and the need to know > the class's internals, it is the class itself > and the programmer creating it. Sure, I'd agree about the 'right' . . . but still would want to minimise the Need... Regards, Bill