Discussion OOP
There is a joke:
One person arrived in Silicon Valley, found that there was a monkey, one 1,000 dollars, one question, the original monkey can write a good C language code; there is another monkey next to another monkey, worth 5,000 US dollars, the person is strange Boss: What will it?
Boss answer: it will write C code, object-oriented, very popular!
"Pop" is indeed very attractive, I also start learning C because of "popular". But the popularity is not necessarily good, such as SARS.
?
Koening Master has a famous saying: use class to express the concept. In fact, Bijarney is invented by C , the purpose is to make every concept clarify.
The Taiwanese tube is a target called: "Biography", this statement is very image. Our actions are role on a certain thing (object), and the object is combined with the action of it, it is a "object-oriented" model.
The benefit of object-oriented program development is packaged, each concept and related operations are combined with "class" into a whole, and an instance of the class is "object", and the object is transmitted through message delivery, and specific to each other Real is not concerned. In this way, we only need to care about whether every "concept" is correct, and there is no matter what is "concept".
?
Another benefit of object-oriented is "combination" and "inheritance". Two types of wheels and frames are combined into a car, while motorcycles have inherited all functions of the bicycle and their additional features.
The class that mates between each other can be "combined", and there is a function of functioning between each other to "inherit". This needs to be particularly concerned, otherwise a "ostrich" class actually has a "flight" method.
A cock grabbed the hen of the egg to fight, why? Because the hen got a duck egg.
OOP is a double ax, it can make you easier, you can also give you a lot of inexplicable mistakes.
?
There is no advantage for scientific calculations and other-oriented operations. Scientists don't have to prepare a "high-order partial sub-equation" class for scientific calculations. Conversely, if the structured language such as Fortran is used, regardless of the efficiency or the quality of the program, it can be expected to be far more than the OOP language.
In transactional, there is also a Windows application, OOP's advantages are obvious. Due to OOP packages and expandability, the program has good stability and maintainability.
?
Understand the principle of object-oriented, it is easy to understand why it will pop, that is because
Windows
Popularity. Give full play to the advantage of a language, what is used for what is the correct attitude.
5000
Dollar
C
Not necessarily
1000
Dollar
C
It is even better.