4 ms·
The redeeming quality of C++ is that there's nothing better in its specific niches. The question to ask is: - do you just care about results: I need a program
by frig 17y ago
The redeeming quality of C++ is that there's nothing better in its specific niches.
The question to ask is:
- do you just care about results: I need a program that produces these outputs when given these inputs
- or do you care about what actually happens: I want the computer to do this, then this, then this, in exactly this way please.
...?
It's usually a good idea only to care about the former -- the essence of functional programming, higher-order functions, etc., is to be able to focus on the former as much as possible -- and so long as you only care about the former C++ doesn't have much to recommend it except in special circumstances.
On the other hand, there are times when what happens, exactly is important (eg: device drivers, other low-level code, directly interacting with hardware, etc.). In that scenario what C++ offers is a language that standardizes a lot of the functionality that most sufficiently-large raw-C programs have implemented in an ad-hoc basis.
There are other ways of doing low-level code, but at the present time C++ is the best of bunch (or at least the safest choice if you have an eye to the long term), not so much b/c it's particularly awesome but b/c the others have either faded away for business or political reasons, or b/c the others made limiting choices (C++ makes very few decisions for you, which means it's equally suited -- or unsuited -- to every task in its particularly niche).
- rmaccloy 17y agoI don't have a dog in this fight, but a major thesis of the article is that this is effectively not true for C++ (vs C) because the language is so complicated (thus the implementations so inconsistent/subtly incorrect) that it's incredibly difficult to determine exactly what the compiler is going to do with your input (or conversely, determine what in your input caused a given error in your object code.)