C++: A Garbage Heap of Ideas
Seibel, Peter. Coders at Work: Reflections on the Craft of Programming. New York: Springer-Verlag New York, 2009.
One of the more delightful aspects of Seibel's book was finding that when it comes to C++, I'm in good company: people hate C++! The interviewer, Peter Seibel, is obviously biased against C++. However, this doesn't diminish the main criticisms against Stroustrup's spawn, namely:
- it's got too many features, so humans end up using mutually unintelligible subsets of the language
- it's too complicated, so every compiler implements the features differently
- visually, C++ looks like crap
I've reproduced my favorite quotes from Seibel's book below.
on languages he used besides Lisp
Zawinski: And C++ is just an abomination. Everything is wrong with it in every way. So I really tried to avoid using that as much as I could and do every thing in C at Netscape. Which was pretty easy because were targeting pretty small machines that didn't run C++ programs well because C++ tends to bloat like crazy as soon as you start using any libraries.
Seibel: But not as bad as C++.
Zawinski: No, absolutely not.
on the engineers at Collabra (whose management apparently took over Netscape),and
Zawinski:...when the people who had been successful said to them, "Look, really don't use C++; don't use threads," they said, "What are you talking about? You don't know anything."
Well, it was decisions like not using C++ and not using threads that made us ship the product on time...
Siebel: Was the 4.0 rewrite from scratch?
Zawinski: They didn't start from scratch with a blank disk but they eventually replaced every line of code. And they used C++ from the beginning. Which I fought against so hard and, dammit, I was right. It bloated everything; it introduced all these compatibility problems because when you're programming C++ no one can ever agree on which ten percent of the language is safe to use. There's going to be one guy who decides, "I have to used templates." And then you discover that there are no two compilers that implement templates the same way.
discussing how languages grow more complex with maturity
Bloch: ...I think C++ was pushed well beyond its complexity threshold and yet there are lots of people programming it. But what you do is you force people to subset it. So almost every shop that I know of that uses C++ says, "Yes, we're using C++ but we're not doing multiple-implementation inheritance and we're not using operator overloading." There are just a bunch of features that you're not going to use because the complexity of the resulting code is too high. ...You lose this programmer portability where everyone can read everyone else's code, which I think is such a good thing.
on learning different languages to be a better programmer
Seibel: No C++?
Armstrong: No, C++, I can hardly read or write it. I don't like C++; it doesn't feel right. It's just complicated. I like small languages. It didn't feel small and simple.
on using C++
Fitzpatrick: I don’t mind it. The syntax is terrible and totally inconsistent and the error messages, at least from GCC, are ridiculous. You can get 40 pages of error spew because you forgot some semicolon. But—like anything else—you quickly memorize all the patterns. You don’t even read the words; you just see the structure and think, “Oh, yeah, I probably forgot to close the namespace in a header file.” ...
discussing what languages he uses at work
Thompson: I write mostly in C. I do all my test stuff and toy stuff in C while google is C++, strictly C++. It's no big deal programming in C++, but I don't like it. I resist it.
Seibel: You were at AT&T with Bjarne Stroustrup. Were you involved at all in the development of C++?
Thompson: I'm gonna get in trouble.
Seibel: (channeling Connie Chung) That's fine.
Thompson: I would try out the language as it was being developed... It was very unstable for a very long time. At some point I said, no, no more.
Seibel: Can you say now whether you think it's a good or bad language?
Thompson: It certainly has its good points. But by and large I think it's a bad language. It does a lot of things half well and it's just a garbage heap of ideas that are mutually exclusive. Everybody I know, whether it's personal or corporate, selects a subset and these subsets are different. So it's not a good language to transport an algorithm--to say, "I wrote it; here, take it." It's way too big, way too complex. And it's obviously built by a committee.
Stroustrup campaigned for years and years and years, way beyond any sort of technical contributions he made to the language, to get it adopted and used. And he sort of ran all the standards committees with a whip and chair. And he said "no" to no one. He put every feature in that language that ever existed. It wasn't cleanly designed--it was just the union of everything that came along. And I think it suffered drastically from that.
Seibel: Do you think that was jsut because he likes all ideas or was it a way to get the language adopted, by giving everyone what they wanted?
Thompson: I think it's more the latter than the former.