<div dir="auto">Yes, good points. And it’s not like this is going to be the final Morphic design, it will continue evolving and improving with new ideas. Thanks!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Sep 8, 2024 at 19:43 Juan Vuletich <<a href="mailto:juan@cuis.st">juan@cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">On 9/8/2024 7:22 AM, Luciano Notarfrancesco via Cuis-dev wrote:<br>
> Interesting. I cannot give a very informed opinion because I don’t <br>
> program with Morphic very often, but I have some doubts about using <br>
> inheritance for this (and why not for other properties? ColoredMorph, <br>
> BorderedMorph, etc?). I wonder if it could be implemented with <br>
> properties instead (optional properties, that a morph might have or <br>
> not), or by composition. The reason to not use properties and make it <br>
> an instance variable is for speed?<br>
><br>
><br>
<br>
Well, it is about code complexity. It is not about wether it is an ivar <br>
of a property, but about how much code is needed to implement it. I <br>
think that using composition would lead to a lot of additional code, <br>
that would take more time to browse and understand, and more stuff to <br>
hold in your head. I'd like to be proven wrong, though (with a specific <br>
implementation we can all look at and discuss!).<br>
<br>
WRT colors and borders... Yes. Design is not an exact science at all. I <br>
think that conflating together "being a box aligned with coordinate <br>
axes", "having a fill color" and "having an (optional) colored border" <br>
together make for a compact way (minimum set of classes and methods) to <br>
do these three features, especially on a single inheritance system. Some <br>
morphs saying "I don't care about border, I'll ignore that" is less <br>
distracting that "yeah, I might have padding, go learn what that means, <br>
and how it is used elsewhere but not here, because I'll ignore it". So, <br>
it is a thin line.<br>
<br>
The trade offs of single inheritance vs. multiple, traits, prototypes, <br>
composition, etc, have been the focus of discussions about dynamic <br>
language design for decades. Smalltalk is a single inheritance system, <br>
and my aim is to use that to get code that is clear, easy to understand <br>
and adapt to new knowledge as we learn. Software design is, of course, a <br>
creative activity, and (in my opinion) there are no rules carved on <br>
stone. Each time we need to consider the options and pick one.<br>
<br>
And of course, the hierarchy is flexible enough for anyone wanting a <br>
specific subset of these features, or any other design approach, to <br>
build their own subhierarchy of LocatedMorph.<br>
<br>
I hope this makes sense.<br>
<br>
Thanks,<br>
<br>
-- <br>
Juan Vuletich<br>
<a href="http://cuis.st" rel="noreferrer" target="_blank">cuis.st</a><br>
<a href="http://github.com/jvuletich" rel="noreferrer" target="_blank">github.com/jvuletich</a><br>
<a href="http://researchgate.net/profile/Juan-Vuletich" rel="noreferrer" target="_blank">researchgate.net/profile/Juan-Vuletich</a><br>
<a href="http://independent.academia.edu/JuanVuletich" rel="noreferrer" target="_blank">independent.academia.edu/JuanVuletich</a><br>
<a href="http://patents.justia.com/inventor/juan-manuel-vuletich" rel="noreferrer" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a><br>
<a href="http://linkedin.com/in/juan-vuletich-75611b3" rel="noreferrer" target="_blank">linkedin.com/in/juan-vuletich-75611b3</a><br>
<a href="http://twitter.com/JuanVuletich" rel="noreferrer" target="_blank">twitter.com/JuanVuletich</a><br>
<br>
</blockquote></div></div>