C++ is a multi-paradigm language, and the paradigm that is most strongly associated with C++ is Object-Oriented Programming (OOP). As a result, we find all these beautiful dog-cat-mouse examples in books and tutorials. Experience shows, however, that most real software packages do not contain such deep class hierarchies as the literature makes us believe.
It is furthermore our experience that generic programming is the superior paradigm in scientific and engineering programming because
• It is more flexible: polymorphism is not limited to sub-classes; and
• It provides better performance: no overhead in function calls.
We will explain this in more detail within this chapter.
On the other hand, inheritance ...