3 ms·
I don't understand this particular criticism of C++, and I generally think there are a lot of legitimate criticisms of C++. Yes, the language spec has become co
by fasterik 3y ago
I don't understand this particular criticism of C++, and I generally think there are a lot of legitimate criticisms of C++. Yes, the language spec has become complicated. But you don't have to use every single feature in the language. As the slogan goes, if you don't use it, you don't pay for it.
I find that the style I like best is what John Carmack calls "C flavored C++". To me this means plain structs and functions, references instead of pointers when appropriate, and conservative use of: templates, constexpr, operator overloading, strings, vectors, threads, and synchronization primitives. This subset of the language is relatively easy to learn and pleasant to use. Still, I will have no problem jumping ship to one of the newer C++ replacement languages when one that I like becomes mature enough.
- creer 3y agoYears ago, when I considered C++ (and discarded it), it seemed that it was hard to write C++ without understanding most of the features. Let's not argue about THAT. But is there now an accepted small subset that can stand alone as a first layer of study and usage? Giving a real understanding of that subset and being able to write in that subset? Any text describes this? This idea of layers in learning a language seems fundamental to me - (Perl 5 was - still is - amazing for that. Perl 6 / Raku is great but it lost that.)
- guenthert 3y ago> But you don't have to use every single feature in the language With a large language like C++ it is indeed quite common that teams agree (or are agreed upon) a subset to use, yes. > As the slogan goes, if you don't use it, you don't pay for it. That's not quite true though. You don't get to chose which feature has been used by the people who wrote the code you're told to fix. > I find that the style I like best is what John Carmack calls "C flavored C++". And this is a matter of personal preference. I would have embraced a strict, statically type-safe, OO language with focus on code-reuse, maintainability and performance, not based on C (I do like C for what it is, but it clashes badly with the other goals).
- fasterik 3y ago>You don't get to chose which feature has been used by the people who wrote the code you're told to fix. True, but that's more of a sociological problem than a technical problem. It's a question of how projects and teams enforce programming styles. I do see the advantages of a language like Go where it's been designed with a minimal set of features to restrict the range of crazy things you can do. But if your project has certain constraints, like not using GC, then Go is a non-starter. The big advantage of C++ is that it's suitable for making literally any kind of software, from embedded to web applications.