SJS wrote:
begin quoting James G. Sack (jim) as of Fri, Mar 21, 2008 at 12:48:21PM -0700:
[snip]
I enjoyed the video, and recommend it.
One of Alex's remarks was exactly what you say CS, that inheritance
introduces coupling, and you should go into such arrangements knowing
what the tradeoffs are. He did say that he thought mixins were one of
the areas where inheritance especially shined.
"Knowing what the tradeoffs are" is wise advice.
Minimize coupling (within reason), maximize cohesion (within reason).
Getting back to your original statement, I would concur that deep
inheritance trees are probably uncommon in terms of actually being
useful and justified.
Very deep or very wide inheritance trees should probably be avoided.
Very wide is preferable to very deep.
Wide only increases cognitive load linearly. While this is non-trivial
to manage, it is on the order of everything else in programming you have
to manage.
Deep increases it as n log n or n^2 since you have to take into account
the interactions between all the classes. This is bad.
-a
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg