r/cpp • • Dec 07 '22

C++ overtakes Java in language popularity index

https://www.infoworld.com/article/3682141/c-plus-plus-overtakes-java-in-language-popularity-index.html
382 Upvotes

137 comments sorted by

View all comments

-8

u/WilsonWeber Dec 07 '22

But Rust is Growing So Fast

I think Rust Overtake C++ in future

3

u/konm123 Dec 07 '22

I do not think Rust will overtake c++, because in the end it boils down to what problems we are solving with the language - it is is measly implementation specific things. By far, most of the development effort goes into concept engineering and design. C++ has been around a long time, new things are nicer than ever before. With a decent static analyzer for C++, Rust loses its edge over C++ because suddenly, your static analyzer will report most of the memory problems as Rust does.

It really is not a competition. I see future for the both languages. For new projects, absolutely, go ahead and start implementing them in Rust code.

Ada/SPARK is probably most serious potential overtaker for Rust to look out for. More and more big companies have already started looking towards Ada/SPARK (such as NVidia for its firmware). It gives you everything Rust promises and so much more with its built-in static analysis. Moreover, it is much easier to get into and write - Ada is relatively simple language, much simpler than C++ or Rust.

So, in terms of safety, I would summarize: Ada/SPARK > Rust > C++, and I see all of them being actively used in the future.

6

u/Aggressive_Release94 Dec 07 '22

With a decent static analyzer for C++, Rust loses its edge over C++ because suddenly, your static analyzer will report most of the memory problems as Rust does.

This is simply not true though. At least at this point in time, static analysis in C++ doesn't even catch half of the memory safety issues detected by the Rust borrow checker. Not just that, writing multithreaded apps in C++ is extremely error prone and the Rust borrow checker is miles ahead here.

-1

u/konm123 Dec 07 '22

What C++ static analyzer do you have in mind?