[Cuis-dev] Interesting thoughts about Color

Phil B pbpublist at gmail.com
Sun Apr 28 17:43:55 PDT 2019


On Sun, Apr 28, 2019 at 8:07 PM Juan Vuletich <juan at jvuletich.org> 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)
>
>
> Maybe we could add a 'but' prefix. For example `Color red butDarker`.
> Would that sound better?
>
>
I think that would be better.  (FWIW, my first thought was along the lines
of #asDarkerColor which fits with the other #as* methods but doesn't read
as nicely)

>
>
>> WRT making Color immutable... All methods that change state are marked
>> as 'private'. What else do you suggest?
>>
>>
> Prefixing the setters with #private<whatever> would be my preference.
>
>
> I see. Yes, that would be nicer. But Color already inherits #at: and
> #at:put: which we can not rename. In addition we'd need to change that all
> over the system for consistency. If my script was correct, Cuis includes
> 180 classes with a 'private' method categories.  What I'd like to have is
> real immutability.
>
>
I hear you re: some sort of 'real' immutability... in the meantime we do
what we can ;-) (I'm used to faking it in languages like Obj-C so it
doesn't bug me too much not to have it)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190428/e9439f44/attachment.html>


More information about the Cuis-dev mailing list