3 ms·
In almost all programs inheritance is for re-using code, so it is implementation inheritance. The big problem with that approach is that in most cases there is
by aliasEli 5y ago
In almost all programs inheritance is for re-using code, so it is implementation inheritance. The big problem with that approach is that in most cases there is no contract for sub-classes, the properties that a sub-class is required to have. This can lead to very messy class hierarchies.
Also note that a lot of problems disappear when objects are immutable.