务虚篇

来源:互联网 发布:舰娘破解版无需网络 编辑:程序博客网 时间:2024/04/28 11:31

There are two primary aspects to the programs we write:
  1. A collection of algorithms (that is, the programmed instructions to solve a praticular task);
  2. A collection of data against which the algorithms are run to provide each unique solution.

These two primary program aspects, algorithms and data, have remained invariant throughout the short history of computing. What has evolved is the relationship between them. This relationship is spoken of as a programming paradigm.

Procedural promgramming: a problem is directly modeled by a set of algorithms, the data is stored separately, accessed either at a global location or by being passed into the procedures. (FORTRAN, C, Pascal...)
Object-based programming: a problem is modeled by a set of data abstractions, the algorithms associated with each class are referred to as the class's public interface, the data is privately stored within each object; access of the data is hidden from the general program. (CLU, Ada, Modula-2...)
Object-oriented programming: extends abstract data types through the mechanisms of inheritance (a reuse of an existing implementation) and dynamic binding (a reuse of an existing pulic interface). (Simula, Smalltalk, Java...)

C++ is a multiparadigm language. We are able to provide a solution best suited to the problem.