3 ms·
C++ is old. It inherits most of C, which is also old. No other language has had to maintain backwards compatibility for roughly ~40 years, through generations o
by zanny 9y ago
C++ is old. It inherits most of C, which is also old. No other language has had to maintain backwards compatibility for roughly ~40 years, through generations of programming paradigms, while also trying to stay relevant. Modern C++ is a ton of new functionality mostly because its adding another paradigm to the language - since C++11 it has gotten much more functional.
Just look at how Python ended up if you want to see what happens when you try to backwards-break a language. And C++ is oh so much worse at that - if you make a non-compatible language iteration it would also (probably) break the ABI, which means "new" C++ cannot link old C++. It would make two languages. And nowadays, you really only have one of three reasons to write C++:
* You already have a C++ project.
* You need to use a C++ library / supporting code / integrate with C++ directly (and not through a C API).
* You want a feature only a C++ construct / library can provide. Qt is a great example of this, because there really is nothing comparable to it on any other platform in terms of a cross platform native UI toolkit, and using bindings can work but introduces a lot of build system complexities.
So C++ has all the reasons to adopt new paradigms to make life easier for those who have to use C++, but breaking backwards compatibility defeats all the core reasons you want to use the language. A prettier language is useless if you cannot get real work done in it.
- fatbob 9y agoHow about real-time control? What's the alternative?
- pjmlp 9y agoAda, SPARK, Pascal, code generation using formal model, in some soft-real time cases Java (RTSJ 2.0). But it will be an up-hill battle if not working alone, unless one is working in high-integrity related industries.
- jononor 9y agoHopefully Rust will eat up the real-time domain, at least for tasks which aren't best served with formal or model-based methods. It might already be usable, most of the essential pieces seem to be in place. No GC, many parts of stdlib, typed arena for memory pools etc. Move operations and immutable by default should reduce tendencies for defensive copying. But best-practices, documentation and tooling for real-time is not on par with C++ yet. Though real-time is an underdocumented art in general..