[Cuis] Where to put the complexity?

Ken.Dickey Ken.Dickey at whidbey.com
Mon Jun 29 08:51:05 CDT 2015


On Mon, 29 Jun 2015 07:09:43 -0400
"Phil (list)" <pbpublist at gmail.com> wrote:
> ..  Is it
> worth having a class for this vs. raising the more general Notification
> and then checking for a #ReparseAfterSourceEditing signal, and if it
> isn't, re-raise Notification in its sole handler?
> ..
> This is a specific example of the more general question of where to draw
> the line on having single, or very limited, use classes and methods vs.
> adding a tiny bit of complexity in one or two methods to simplify the
> overall image or package in question.  Thoughts?  

I would say the overriding goal is clarity.

It is important work to refactor code to have the same behavior but be easier to understand.

A Smalltalk style goal is to have small methods which do things clearly.  This tends to lead to lots of small methods.

Specializing classes for one or just a few methods may seem wasteful, but computer resources are cheap.  

Look at class #PartsBinMorph.  Would you say the having the additional class is wasteful?

It is a tough balance.  Aesthetics and restraint require judgement and we don't always get it right.  It takes time.

I only have so many life hours left.  I feel my time is valuable.  I prefer to understand.

Thank you so much for taking the time to make Cuis more comprehensible.

$0.02 
-KenD




More information about the Cuis mailing list