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

Re: OO should break when broken(was re: the benefits of immutability)



On Monday, September 1, 2003, at 06:14 AM, Colin Putney wrote:
> An ellipse is a circle with additional capabilities - it can have 
> different radii along each of its dimensions.

This reminds me of something that bothers me about OO:  the 
accumulation of unused stuff.  When I extend Circle to make Ellipse, I 
add x-radius and y-radius, but the original radius instance variable is 
still there.  Since I'm not going to use Circle's radius any more, I 
wish I could just ask it to go away, if the compiler or runtime could 
verify it isn't needed by methods I decide not to override.

Geoffrey

P.S.  Thanks for the Smalltalk example.  It reminds me of an era of 
lightweight expression and immediate interoperability.

--
Geoffrey S. Knauth | http://knauth.org/gsk