The Costs of Inheritance

Yet nothing in life is ever free. There are costs associated with the use of inheritance. Message passing does impose a small penalty on execution speed -- this is why many numeric algorithms or high performance real-time systems avoid the technique. General purpose tools tend to provide more functionality than is necessary in any one situation, and thus may increase program size. Finally, object-oriented techniques remove one aspect of complex, but inheritance can, if not carefully controlled, introduce another as to understand a class one may need to understand all the parent classes.

All this does not mean you should not use inheritance, but rather it means you should understand the benefits, the advantages being bought by inheritance, as well as the costs.

[audio] [real] Text to accompany slide19, in Chapter 7 of An Introduction to Object-Oriented Programming