I don't get these rants. Both C and C++ are such barebone languages that you can take or leave pretty much everything but the common syntax. Zed decides C's string functions are not up to scratch, and so uses bstring. Plenty feel the same about std::string, and will use bstring's CBString, Qt's QString, or some other class in their C++ code. Exceptions? Take them or leave them. setjmp/longjmp? Take them or leave them…
The problem is, your co-workers will do the same with other features. Unless the project is under a strong dictatorship, you'll end up taking everything.
Zed Shaw on C++
151–160 of 210 posts
Re: Zed Shaw on C++
#152I don't get these rants. Both C and C++ are such barebone languages that you can take or leave pretty much everything but the common syntax. Zed decides C's string functions are not up to scratch, and so uses bstring. Plenty feel the same about std::string, and will use bstring's CBString, Qt's QString, or some other class in their C++ code. Exceptions? Take them or leave them. setjmp/longjmp? Take them or leave them…
The problem is, your co-workers will do the same with other features. Unless the project is under a strong dictatorship, you'll end up taking everything.
Re: Zed Shaw on C++
#153Earlier quoted context omitted.
I donate you one: #include #include #include typedef std::vector Strings_t; Strings_t split(const std::string& string, char onChar) { Strings_t splitted; size_t lastSplit = 0; for (size_t i = 0; i
I never said I didn't know where to get one, or to actually write it. In fact, you can do it way simply with getline(). It just always pissed me off when I hack a little something and there is no split.. I then need to either include boost which is huuuuge compared to my 200 lines file.. code it myself, get a snippet from internet. The point is: in C++, there are so much things.. It's like a fuckload of thousand of f…
Re: Zed Shaw on C++
#154I'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 stri…
"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…
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.
Re: Zed Shaw on C++
#155I'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 stri…
"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…
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?
Re: Zed Shaw on C++
#156Earlier quoted context omitted.
Perhaps you could point out the funny bit.
Oh, you have to read that in the voice of The Comic Book Guy. Then it's fucking hilarious. Here try it: "You sthee const const &const char[const ] is the proper way to make a thruly safe reference to a conthst char array conthst pointer conthst." See, prime comedy gold there. Also, 'cause you guys think the internet should be nothing but a massive academic white paper curated by Knuth, so any amount of hyperbole send…
Re: Zed Shaw on C++
#157Earlier quoted context omitted.
"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…
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 issue…
Re: Zed Shaw on C++
#158Re: Zed Shaw on C++
#159After my C++ period, I did a major project for myself and just used C - like a breath of fresh air after C++
In all my years using C++, I think that the only good applications where C++ made sense was in Nintendo and PC game development at Angel Studios and some VR development for Disney and SAIC. Everything else that I did in C++ should have been done in different languages.
Re: Zed Shaw on C++
#160I'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 stri…
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++.