D vs. C#

Janice Caron caron800 at googlemail.com
Sun Oct 21 04:25:10 PDT 2007


On 10/21/07, Janice Caron <caron800 at googlemail.com> wrote:
> On 10/21/07, Yigal Chripun <yigal100 at gmail.com> wrote:
> > object.doSomething(params);
> > ---
> > is more OOP correct than:
> > ---
> > a = object.getField();
> > b = doSomthing(a, params);
> > object.setField(b);
>
> I think that's wrong.

Also, the fact that one can write a getter function without a setter
function allows one to define properties which are read-only to the
outside world, but read-write to the containing object, which again is
something you can't do with a plain member variable.



More information about the Digitalmars-d mailing list