I really dislike C++ but more to the point I really dislike other people's C++. This is triple compounded when you only have to do C++ occasionally. I've never even got close to the point of looking at something like const *const char & and reading it like it was something normal like others seem to do.
I really dislike C++ but more to the point I really dislike other people's C++. That's right on the money. I can find a subset of C++ that I like and that I could program with, but that assumes that I'm not collaborating with someone and that I don't have to use C++ libraries (It's not just the code, it's the APIs, too). The latter is almost worse. I could imagine a company that has some rather strict standards, wher…
Zed Shaw on C++
91–100 of 210 posts
Re: Zed Shaw on C++
#92Earlier quoted context omitted.
The great thing about const is that if you don't like it you can pretty much ignore it. The only time it might be necessary to deal with it is if you are using a library that returns const objects. If you do like const (which I do) then you can put it in pretty much everywhere, except if you are dealing with a library that isn't "const correct", but then a bit of type casting will save the day. That's a big advantage…
That's usually considered a drawback of C++; it's a huge, complicated language and everybody tends to use a different subset for their own work.
Re: Zed Shaw on C++
#93Re: Zed Shaw on C++
#94Earlier quoted context omitted.
Perhaps you could point out the funny bit.
He mocks that you can attach const nearly anywhere in c++ and it seems to do something different. (Note: This is a generalization, an important aspect of many jokes)
Re: Zed Shaw on C++
#95There appear to be a lot of good rants against C++. To name a few: * Linus Torvalds : http://lwn.net/Articles/249460/ * C++ Frequently Questioned Answers : http://yosefk.com/c++fqa/ Are there any good passionate pro C++ versus C arguments?
It has grabbed and maintained complete domination of nearly all performance sensitive code in games and desktop software, for nearly a generation now which is an unprecedented reign in computing history. That's a pretty good start to me.
Re: Zed Shaw on C++
#96Qt, wxWidgets, LLVM, boost
Hopefully we have IncrediBuild at work, and we don't have to deal all the time with such huge frameworks.
Re: Zed Shaw on C++
#97I understand that the language cannot express it, and that's why other languages (such as lua) do it the right way - immutable strings all the way, or at least by default (NSString)
Re: Zed Shaw on C++
#98Exceptionally good critique. But there are exceptions: programming for Google's V8 in C++ is a pleasure. I've never seen any interpreter code so clean and easy to extend. Like a breath of fresh air.
Embed V8 into Python, then tell me how great C++ is. In other words, C++ is great until something else has to call it. Then you're hosed and end up wrapping everything in C anyway.
I certainly relate to what you wrote because I used to be a C++ dev in mid-90s (wintel, shivers.) But if you have some time, have a look at V8 for developers. It rocks. Also the newsgroup has a great community.
Re: Zed Shaw on C++
#99 f() {
LinkedList list;
populate(list);
use(list);
//forget
}
Freeing the list elements is done in one place only, in the destructor of LinkedList. In C, you have to call some kind of free function in every single place a LinkedList is used. The burden of managing memory is on the user of a library, not on its creator. I don't think this is enough to justify using C++ though.Re: Zed Shaw on C++
#100Exceptionally good critique. But there are exceptions: programming for Google's V8 in C++ is a pleasure. I've never seen any interpreter code so clean and easy to extend. Like a breath of fresh air.
It's not exceptional because nothing of the points he raises are anything but a re-re-rehash of the same old tiring arguments that have been raised against C++ for 15 years or more.
It's not good because the examples he makes are straight up wrong or so vague as to be useless. His 'const' example is jibberish and the line about adding two integers with templates doesn't make any sense whatsoever. I guess the response to this would be that these points were exaggerations, mere literary style figures, which is fine. But it does take away from the quality of it as a serious post.
And finally it's not a critique. A critique implies some level of sophistication, an honest attempt to understand something and providing well thought-out arguments against the trade offs that were made in the design, or different viewpoints on fundamental issues. This is just a rant, touching on some of the more superficial shortcomings of C++ that are easily worked around and that for the most part haven't hampered tens of thousands of C++ programmers to use the language successfully for 20 years. A rant, yes. Venting, OK. But a critique, this is not.