In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "C++ language Cross-platform". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "C++ language Cross-platform" together.
If you want to run Java programs, you must run on a virtual machine, while C++ language is not, C++ program code is run directly on the physical machine, the so-called C++ language: is a very widely used computer programming language.
C # is more like the product of a business struggle between Microsoft and SUN. Historically, Microsoft has supported the Java language, with typical products such as Visual Junction + and WFC. Later, for well-known reasons, Microsoft launched Craft, whose purpose is very clear, that is, to compete with Java.
In fact, C # and Java are also very similar in features (not just syntax). Both of them are in order to solve application problems more conveniently, and there are mature solutions in GUI, database access, network communication, multithreading and other points closely related to practical applications.
C++ relies more on third-party libraries to achieve these functions, because C++ language is an international standard, and there is still a long way to go to add application-oriented features beyond these languages to C++. The owners of C # and Java are commercial companies, and their movements are naturally much more agile.
But that doesn't mean C++ is dying (there's a lot of talk about it). It is undeniable that C++ has lost some areas under the attack of C # and Java, but C++ is still widely used, not least because C++ not only maintains C-level efficiency (with some exceptions), but also adds object-oriented features.
The main differences between C++ and other languages
Generally speaking, the differences between C++ and C# and Java focus on the following points:
(1) the compiled C # and Java code (forming intermediate code) is executed on the virtual machine. C++ is not.
(2) compared with C++, C# and Java are relatively simple and easy to use. The grammatical features of C++ are many, complex and difficult to master.
(3) C++ language itself is a standard, there are differences between various implementations, and the degree of understanding and implementation of the standard is also different. While the C # and Java languages are mastered by commercial companies, there are few problems in this regard.
(4) C # and Java are directly application-oriented, and various standards and models are very mature. However, various libraries of C++ may encounter some problems in the implementation of different C++ compilers.
(5) all three are object-oriented. C # and Java are more thorough than C++. There is a view that C # and Java are thoroughly object-oriented languages, which is inappropriate, because there is no specific standard for object-oriented languages. For example, there is also a view that Ruby, which is very popular recently, is more object-oriented than C # and Java.
(6) C++ has many modern and exciting language features, such as templates, generic programming and so on. At this point, C# and Java are also rapidly following up. C++ is a delicate and artistic programming language. The author believes that C++ is also one of the most flexible and difficult programming languages known. Basically, learning C++ well also means learning any other high-level programming language. Figure 1.1 compares several aspects of C, C++, C #, and Java.
First of all, repeat Bjarne's words: "our system is already extremely complex, in order to avoid the complexity of C++, simply do not use C++ (Linus approach), is tantamount to giving up eating for fear of choking." C++ is a better language than C in all the areas where C and C++ are available. When I say "better," I'm saying that C++ has safer type checking, better abstraction mechanisms, and better libraries than C. Of course, there are exceptions to everything, if you do project 1) not big. 2) there is no abstract mechanism in coding.
Even ADT (abstract data types, such as std::complex, which does not contain polymorphism and inheritance), RAII, and exceptions are not needed. 3) you don't even need basic libraries (such as smart pointers and smart containers that simplify resource management). Then maybe it's okay for you to use C; so if that's your case, don't argue with me, because I can't refute you. The areas we are talking about here are roughly those that Bjarne listed in the list of C++ apps.
The bottom line is: if you get rid of many unnecessary complexities in C++, leave those essential and important language features, simplify the language model, and eliminate the historical burden. Even opponents of C++ may find it hard to find a reason to say, "I still don't use C++." In my opinion, a person who is really rationally opposed to using C++ in a practical sense has only one reason: the confusion caused by C++ 's complexity offsets or even outweighs the benefits of C++ 's abstract mechanisms and libraries (in his particular project).
It is worth noting that there is a trap to be avoided here, that is, once people decide that "C++ is bad", then this reason will "grow their own feet", that is, even if we remove the complexity of C++, they may also insist on not using C++ language and find a bunch of reasons for it.
I assume you're not like that. However, perhaps the most likely thing is that he will say: "the problem is that the C++ we use today is not so (concise), and your hypothesis is not valid." Yes, my hypothesis is not valid. But although we cannot eliminate complexity, we can actually easily avoid complexity and avoid weaknesses and strengths. This is also the main point of this article, let me elaborate later.
Of course, you might still say. I still don't use C++ because I can use D, or if the project you're working on doesn't need clocking, you might say, I use Python. First of all, if your project can be done in Java/Python or even Ruby, then using C++ is asking for trouble.
Because it is not very efficient to represent your project in those languages, what is the value of using a language that is less efficient but more complex? Second, if your project efficiency is important, you might say you can use D.
However, the reality is that D is rarely used in industry, especially in China. The C++ language, on the other hand, has a lot of existing code, and companies that have used C++ to make their products will be almost impossible to rewrite code in other languages for a long time, as Joel said, decided to rewrite an extraordinary code base = suicide.
Thank you for your reading, the above is the content of "C++ language Cross-platform?", after the study of this article, I believe you have a deeper understanding of the C++ language cross-platform problem, the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.