[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: s-exprs + prototypes



On 2003.06.24 10:48 Christopher Barber wrote:
> I disagree.  Not allowing objects to have mutable state would weaken the
> object
> metaphor to the point where the average programmer would find it hard to
> grasp.
> The way humans perceive the real world, objects can and do have mutable
> state.

I don't think mutability is at all necessary for objects.  It's true
that it's disorienting to programmers schooled in imperative languages,
but the most OO-oriented programmers should actually have an easier
time than the others.  Much of the craft of OO programming involves
managing the expression of state -- separating internal state from
externally perceived state, hiding the former and controlling access
to the latter.  The step from this to immutable objects is big, but
entirely within the OO paradigm.

Michael


-----------------------------
Michael St. Hippolyte
http://www.bentodev.org