I'm going to keep saying this until I turn blue in the face. Perhaps if I stamp my feet it might get more attention (wink)
Please stop confusing the language with the APIs or the available libraries and features of the language.
This sounds simple, but it's profound: simply because you can do something, that doesn't mean that you have to do it that way.
To use Zed's example, let's say I'm hacking around a lot of strings. What's wrong with rolling a string class, adding a member or two? You only have to carry around a bunch of nonsense if you want to. If you don't want to use templates and strings and such, don't use them.
This is another in a long line of articles that go something like this: We did X in this certain way, and boy did it suck. Therefore all of X is the devil's work and will destroy civilization.
You can put about anything you want in for X. It's like a (oddly enough) template engine for writing blog entries.
You should go through stages in your career, with just about any X. Stage one is that you are ignorant. Stage two is that you've tried it. Stage 3 is expertise. Stage 4 is hate, and Stage 5 is grudging acknowledgement that parts of X are okay for certain situations. You realize that yes, X is done poorly maybe 99% of the time, but lots of smart people worked on it and there are some little gems in there that are useful from time to time.
Looks like Zed is stuck on Stage 4
Throw away the templates, throw away all the library stuff you don't like -- is there a reason to make a class and wrap some things? If so, you can do that in C++. You can't in C. It's a very simple question, and it has nothing to do with any of the things Shaw is going on about.
"What's wrong with rolling a string class, adding a member or two?"
The fact that it's 2010?
A language and its standard library are theoretically different things, but in any practical sense, the choice to use a language carries with it the choice to use its standard library. Additionally, the way the standard library is usually reflects constraints placed on it by its language. Java, for example, has a verbose and ceremonial standard library, and that's not a coincidence.
And the fact that it is 2010 relates exactly how to wrapping character array functions? Because I'm not following. If you're in C and using strings, it's still 1985 for you too.
There may be a larger argument about whether the various standards bodies have so complicated C++ that it's become unwieldy -- the comment about exceptions in destructors has merit.
But that's not the argument he was making.
Good programmers are good because of the things they don't do. It's the guys who want to use every feature and library that are often the ones creating the disasters the rest of us have to maintain. So yes, the features and such of a language can hurt. But that's true of just about any language save some of the hardcore functional ones -- C++ maybe more so than the rest. Being a coder using modern languages means judicious use of complexity. Simple is almost always better. Which is exactly where he's coming from, he just takes his argument too far.
In fact, one of the things C++ teaches you early on -- or you suffer all sorts of pain -- is when to abstract, when not to, when to use libraries, when not to, and the dangers of frameworks. It's the very fact that it's such a complex monster that forces coders to keep it simple, stupid. You don't get that kind of thing out of the box in something like Java. This is more bad than good in terms of delivering solutions, but it also is not all bad. It has merit because it trains programmers about the kinds of disasters they can make. If you can write good, easily understood and maintainable C++ code, I can trust you with about anything. If the first thing you do is jump in the swamp where all the alligators live simply because you can -- templates, large inheritance trees, etc -- then probably not so much.
The C++ standard library and std::string implicitly have specific constraints and use cases, but they were imposed by the design process, not by the language.
C++ has many string types because each string type has its strengths and weaknesses. For instance, QString is a fully-featured and Unicode-aware string written in C++ that I use most of the time.
std::string is good for most things. What are your specific issues with it?
I don't write C++ and have no issue with std::string. I was taking general issue with the OP's general issue with criticizing a std library alongside a language.
"A language and its standard library are theoretically different things, but in any practical sense, the choice to use a language carries with it the choice to use its standard library."
That's less true when talking about C/C++ than other languages. C/C++ are quite often used in embedded systems, which often have problems with dynamic memory allocation, code size, etc. This means that many embedded systems don't use the standard library, or only use portions of it.
"is there a reason to make a class and wrap some things? If so, you can do that in C++. You can't in C."
Yes, you can. Object orientation is a property of the program, not the programming language. Pretty much every time I crack open C now, I'm writing Object-Oriented C.
(Also, immutability is a property of the program, not the programming language. Etc.)
mentally replace "language" with "language environment" and all will make sense to you; it will also put you in line with how most people read this discussion.
You: language = base syntax + semantics Most: language = base syntax + semantics + common idioms + standard library + popular libraries
Buried inside C++ there are some good languages; Which one you would use? take one and leave the other stuffs out.
The problems is that you usually target a subset of C++, and two different company targets different subsets. This produce fragmentation and is not good.
Can this be solved/simplified? ages ago someone proposed an embedded C++ standard, and we have compilers in the embedded fields that support this stardard.
Why it does not succeeds? everybody wanted a different subset of C++.
Please stop confusing the language with the APIs or the available libraries and features of the language.
This sounds simple, but it's profound: simply because you can do something, that doesn't mean that you have to do it that way.
To use Zed's example, let's say I'm hacking around a lot of strings. What's wrong with rolling a string class, adding a member or two? You only have to carry around a bunch of nonsense if you want to. If you don't want to use templates and strings and such, don't use them.
This is another in a long line of articles that go something like this: We did X in this certain way, and boy did it suck. Therefore all of X is the devil's work and will destroy civilization.
You can put about anything you want in for X. It's like a (oddly enough) template engine for writing blog entries.
You should go through stages in your career, with just about any X. Stage one is that you are ignorant. Stage two is that you've tried it. Stage 3 is expertise. Stage 4 is hate, and Stage 5 is grudging acknowledgement that parts of X are okay for certain situations. You realize that yes, X is done poorly maybe 99% of the time, but lots of smart people worked on it and there are some little gems in there that are useful from time to time.
Looks like Zed is stuck on Stage 4
Throw away the templates, throw away all the library stuff you don't like -- is there a reason to make a class and wrap some things? If so, you can do that in C++. You can't in C. It's a very simple question, and it has nothing to do with any of the things Shaw is going on about.