Reusing Code in C++: inheriting and template
The worldview of Object-oriented means a lot, including taking an object-oriented perspective to observe things and solve problems. OOP means that creating programs by using objects and creating objects. For an OOP program, the first thing a programmer thinks is what the objects the program would use to solve the problem and build the system, but not solving problem itself. Using and creating different objects are daily common through reusing provided code. Objects are the elements of the program.
Creating new objects by instancing new classes which are the inheritances of old classes is a sub-problem of creating different objects.
All efforts of reusing code in C++ serves classes-creating or type-creating which serves objects-creating. The program uses objects to build systems and solve the problem.
What is inheritance? Why is this facility designed like this? How to understand the Is-a relationship and has-a relationship?
In real and artificial world, the features of more complicated and concrete things or objects are sets of simple and abstract features! So, using integrated sets of abstract concepts and features to describe a special object is a natural developed thought. This thought or process of thinking can be utilized to model concepts from more general to more special!
Formal language with its self-contained is symbolized and information-condensed, formally, also describes the abstract concepts and relationship among them, for example, as mathematics does. Using formal language to model system and represent problem is amazing and powerful. Computer language is one of formal language. Using the thought(the process of t