[Cuis] Where to put the complexity?

Phil (list) pbpublist at gmail.com
Mon Jun 29 06:09:43 CDT 2015


I've been peeking around the image a bit lately and ran across something
that got me thinking about this question: several of the exception
subclasses seem to be largely one-shot affairs.  Granted, the main
categories like Notification, Error, Halt etc. are used all over the
place, have different behaviors and given the importance of what they
convey, provide value.

However, when you start looking at the 3rd+ level Exception subclasses,
some of them look a little sketchy to me.  I'm not talking about more
widely used exceptions like ZeroDivide but rather things like
ReparseAfterSourceEditing... unless I'm missing something, it is raised
in 3 places (in 2 classes) and handled in 1 just so that a very specific
message can be sent to what appears to be a single listener.  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?  The core image part of
the question is directed to Juan (i.e. should I bother reworking things
like this and submitting pull requests when I see them?) but I was also
curious what others thought about this from the standpoint of general
coding style...

Thanks,
Phil





More information about the Cuis mailing list