This is why C ++
-- Reading Notes on the design and evolution of C ++ language (1)
C ++ mostly comes from problems encountered in the actual research process of Bjarne stroustrup. To solve such problems. He is a pragmatic. It is precisely to solve the actual problem that C ++ has a class, so as to have compatibility with other languages.
"The concept of classes enables me to map the concepts in the application directly to the language structure. It is more readable for my code than any other language I have ever seen ". Yes, it is precisely because of this attractive feature that there is no reason not to add this feature to a new language. This advantage is particularly prominent when developing large systems.
Compared with Java, C ++ does not seem completely object-oriented. In C ++, we can still find traces of a large number of procedural languages. Why? You can find many answers online: to be compatible with C. Yes, it is indeed to be compatible with C, but there is something else, that is, the personal thought of the father of C ++-compatibility. "I never want to implement a unique design concept through a restricted programming language definition area. People's way of thinking is so rich and colorful that attempting to implement a single idea always has more disadvantages than advantages. In this way, C ++ is intentionally designed to support a variety of styles, rather than emphasizing the 'one truth path '". With this belief, C ++ naturally becomes a language compatible with other languages, not only compatible with the above C language, but also compatible with other languages such as assembly. The benefit of compatibility is that you can solve specific problems in a specific language. When it comes to solving a specific problem, the advantage of a language may be very obvious. So what is the reason for me not to use this language? There is only one possible answer: maintainability. This is a problem. However, when efficiency or other advantages are especially needed, maintainability often has to reduce its importance.
Portability is also a manifestation of Bjarne's inclusive thinking. Therefore, the portability of C ++ is beyond doubt. From UNIX, Linux to Windows, and a variety of embedded development, we can see C ++.