[Cuis-dev] Interesting thoughts about Color

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sun Apr 28 17:36:21 PDT 2019


On 2019-04-28 16:45, Phil B via Cuis-dev wrote:

> That was pretty much the point being made: rename the methods so it's 
> clear that they are returning a new color rather than modifying the 
> current one.  (i.e. the issue is the naming, not the underlying 
> implementation)

The point here is implementation hiding.

I want names to be polymorphic.  If method names to care about 
mutable/immutable or immediate/vector/composite I lose polymorphism.

I know how the implementation works.  I would like to be able to change 
the implementation and have most code still work.

The classic example is changing character support from ASCII to Unicode. 
(e.g. see package 
https://github.com/Cuis-Smalltalk/EnhancedText/tree/master/Unicode).  
There is a whole bunch of implementation magic, but using the text 
editor pretty much just works.

Changing selectors because they had to indicate how things were 
implemented would have broken encapsulation and causes a huge amount of 
work.

Breaking encapsulation would be very un-Smalltalk!

$0.02,
-KenD


More information about the Cuis-dev mailing list