|
|
|
|
|
by Spivak
1871 days ago
|
|
It’s a misuse because (if you really are only using it for code reuse) it’s creating an essential relationship between different objects that is actually incidental. A list containing two different subclasses of your avoiding-copy-paste base class is now most likely a logical error. |
|
So don't allow those? Supporting inheritance doesn't mean you have to support heterogeneous lists.