Inheritance usually ends up creating a family of classes, all based on the same uniform interface.
This is important because it means you can write a single piece of code that ignores the specific details of type and talks just to the base class. That code is then decoupled from type-specific information, and thus is simpler to write and easier to understand. Thus the program is extensible . Consider the above example. This function speaks to any Shape , so it is independent of the specific type of object it's drawing and erasing.