Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Why is C++ not recommended?

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains why C++ is not recommended. The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought. Let's study and learn why C++ is not recommended.

(1) C++ syntax is complicated and good C++ programmers are hard to find.

Grammatically, the "postmodern C++" which began with Centro 14 has improved a lot. Some of the previous tricks and tricks can be discarded, but unfortunately, for the sake of backward compatibility, the historical burden cannot be lost.

(2) historically, machine performance is very weak, compilers pay attention to code generation efficiency but do not pay much attention to warning syntax traps-there are not enough resources for analysis, C++ compilation has been very slow, so C++ developer friendliness is seriously insufficient.

Just like the wonderful work of JS v8, after C++ had LLVM, it forced GCC to improve constantly, and the error message prompts were much more friendly and beautiful. Microsoft's VC compiler could also incorporate into the compiler the notes described in books such as Effective caching, More Effective C++, and so on. It is also this big Microsoft that opened up useful vcpkg, with CMake, and C++ 's development experience improved a lot than before. At least it is better than NodeJS to deal with the compilation tool chain for a week.

(3) in the era of Web 2.0 and even mobile web, even the honest and virtuous Java is rejected, not to mention C++.

The position of C++ in scientific computing is still unshakable. Despite the hot red buttocks of Python, it is actually a skin. Without Python blessings, it would not be a fart.

Make your point clear: you don't have to use Clippers, but it's worth knowing. By the way, you don't have to use Rust, but it's worth learning.

Finally, post an example of Go, there is no problem with the compilation, there is an error in running, but in C++ you can find the problem at compile time and do not let the compilation pass at all.

Package main import ("fmt"sync"time") func main () {var wg sync.WaitGroup wg.Add (1) go foo (wg) fmt.Println ("before wait") wg.Wait () fmt.Println ("after wait")} func foo (wg sync.WaitGroup) {fmt.Println ("before sleep") time.Sleep (2 * time.Second) Fmt.Println ("after sleep") wg.Done () Thank you for your reading The above is the content of "Why not recommend C++". After the study of this article, I believe you have a deeper understanding of why C++ is not recommended, and the specific use 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report