Re: The cost of sending a message
Posted by
Fernando Rodríguez on
Jan 17, 2005; 10:54am
URL: https://forum.world.st/The-cost-of-sending-a-message-tp3372722p3372736.html
On Mon, 17 Jan 2005 09:30:37 -0000, "Chris Uppal"
<
[hidden email]> wrote:
>However, there is another reason why you might pull the values into local
>variables -- it might make the code clearer. All the self-sends tend to
>clutter up the code and make it less readable. But then if you think that,
>then you'll probably agree with me (/and/ Kent Beck and OA ;-) that
>getter/setter methods are /not/ a good idea in general. I'm in the "strongly
>opposed to accessor methods" camp myself (i.e. I think the "substantial body of
>opinion", mentioned above, is Just Plain Wrong) -- I think they obfuscate the
>code, hide what's going on (an object doesn't have to hide implementation
>details from /itself/ for God's sake ! ;-), and anyway the very concept of
>"accessor method" is an affront to OO thinking. I've never seen a
>justification offered for their use that made much sense at all to me. And, as
>icing on the cake of a bad idea, they also run more slowly...
Thanks, you convinced me... sort of. ;-)
I agree that using an accessor mehtod from within the the class
doens't make any sense, but you seem to go further and consider the
usage of any accessor method fundamentally wrong. Is this correct? If
yes, why? O:-)
Thanks