Re: Holub on getters/setters again

From: Daniel Parker (danielaparker_at_spam?nothanks.windupbird.com)
Date: 01/23/04


Date: Fri, 23 Jan 2004 00:04:03 -0500


"Daniel T." <postmaster@eathlink.net> wrote in message
news:postmaster-5AE91C.21580922012004@news03.east.earthlink.net...
> Ron Jeffries <ronjeffries@REMOVEacm.org> wrote:
>
> > You include methods as getters and setters that I would not.
>
> Your concept of getter/setter is a sub-set of mine.

Yes, but that doesn't make it better from Ron's or (Holub's) point of view.
>From Holub's point of view, your definition of setters would include both
bad methods (what he regards as setters) and good methods (which also change
state). So from Holub's point of view your definition would obscure the
distinction he is trying to make. So it doesn't automatically follow that a
more encompassing definition is a "better" definition, it depends on point
of view.

Regards,
Daniel Parker



Relevant Pages

  • Re: Readonly Property of type collection
    ... with getters, no setters. ... You create a null safe type safe collection ... With regards to your first suggestion - I could return a reference, ...
    (microsoft.public.dotnet.framework)
  • Re: OO in Python? ^^
    ... > getters and setters in Java? ... getters, then it makes sense to write setters and getters. ... insurance against you changing the private interface. ... > a hack in Python (common, "hiding" an implementation detail by prefixing ...
    (comp.lang.python)
  • Re: "Getter" methods no good?
    ... The fear is that if you have getters and setters on an object, then other objects are going to extract the private data of the object, do some processing on it and write it back. ... there are many cases where instance variables of an object are fundamental to the object's behavior and you need to be able to set them or get them. ... BTW, I wrote a physics simulator myself and found that the best algorithm to solve the physics equations was to extract the positions and velocities from the particles, store them into one big vector, run Adaptive Runge Kutta on the vector, then write all the data back. ...
    (comp.lang.smalltalk)
  • Re: Holub on getters/setters again
    ... In this post by DanielT, I find that DanielT is blatantly guilty of ... >> A class with lots of getters and setters may be an indication of ... >> and setters. ... I'm outraged at both DanielT and RCM, and any one of good conscience ...
    (comp.object)
  • Re: How to write Smart Python programs?
    ... Do not write getters and setters. ... In Java, you have to use getters and setters because using public fields gives you no opportunity to go back and change your mind later to using getters and setters. ... In Python, this is silly, because you can start with a normal attribute and change your mind at any time, without affecting any clients of the class. ...
    (comp.lang.python)