DEV Community

[Comment from a deleted post]
Collapse
 
drbearhands profile image
DrBearhands

I damn well hope not. C++ has many fundamental flaws about it. It is a language from a bygone era that only still exists because of inertia (libraries, available programmers etc.) and a lack of serious competition (any GC language has different goals). As you have mentioned, the later is changing and I expect Rust or some other language will replace C++ within 5 to 10 years.

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

"Bygone era" also brings with it precedence, stability, and more of a known quantity about it. It does have its "fundamental flaws", although...

  1. The last two versions (C++14 and C++17) are miles improved from "old-school" C++, offering memory safety and dynamic typing features that rival the new kids in town.

  2. All languages have fundamental flaws; most C++ developers are just comfortable working around the (ever diminishing) set of flaws in the language, as they're a well-known quantity. Newer languages have many flaws that remain as-of-yet undiscovered.

But then, as I've mentioned before, languages seldom die.

That certainly doens't mean C++ will remain unchallenged or ubiquitous, but I think it'll still make up a huge share of game development code, even ten years from now. Rust may well eventually displace C in newer projects, but it lacks a plethora of language features that C++ offers.

When they do, rest assured their adoption rates will increase.

All that actually has nothing to do with "inertia": it's simply that as developers mature, they learn to prioritize stability and known factors over shiny new toys. Major studios don't use C++ because they're a bunch of troglodytes; they use it because of its proven advantages. It'll be some time before the new languages have proven themselves to that extent. Senior developers, meanwhile, don't often pour extensive learning and library development time into those new languages for the same reason. Mayfly technologies abound, and we don't want to waste our time!

Collapse
 
drbearhands profile image
DrBearhands

While your argument may be true for languages such as Java and Go, Rust is a different beast entirely. Where the former are essentially C or C++ with some opinionated changes based on whatever is fancy at the time, Rust is based around linear logic and is thereby backed by solid math. The von Neumann model of C has no such backing. This is what I mean when I say fundamentally flawed.

This was evident e.g. in the slowness with which concurrent programming was adopted, single-threaded performance having stayed a primary concern for gaming systems.
In contrast, initial predictions of MC system design spoke of 64 cores on a CPU by 2012. The lack of compatible software made this rapid scaling of core count unmarketable. This was shown e.g. in the AMD vs Intel debate, where Intel CPUs were better for gaming despite the fact that AMD's higher core count provided higher overall instruction throughput at a lower price.

I love working in C++ (starting from C++14 anyway) and will use it whenever I have a good excuse to do so, but I cannot deny a better, more elegant design when I see one.

I will however, fully disagree with the notion that more features makes a language better. More features means more complexity, which in itself is bad. Of course it might increase the expressive power of a language, but that is just one thing making up the total balance.
This, however, is a matter of personal preference.