5 ms·
We could start with a little honesty. Perhaps the C++ zealots could explain to us how the great new features they promoted for so long were actually a crock of
by rerere 14y ago
We could start with a little honesty. Perhaps the C++ zealots could explain to us how the great new features they promoted for so long were actually a crock of shit. Things like auto_ptr, throw specifications, the export keyword and so forth were promoted as the bee's knees. It's funny how they love to criticize C and its "evil arrays and pointers", but never admit their own mistakes. And they've made so many, so many more than C ever did.
- andrewcooke 14y agotoning down the rhetoric, a good "modern c++" book would be awesome - something that shows how to use a solid, simple core with the latest features in, say, the first half, and then has further chapters extending that with more complex approaches where needed. i've asked for this kind of thing before,but never had a really good suggestion. seems like it could be a huge seller... [when i last asked here what, 6 months ago, i think the only vaguely useful answer i got was to read the draft standard]
- Nursie 14y agoThis sort of thing would be extremely useful for me at the moment. I have a new role starting in a month or so, with a lot of green-field C++ development work. I'm happy with OO concepts and have extended a variety of pre-existing C++ in my time, but my main body of knowledge is most definitely C. Can anyone recommend a quick-start guide to modern(ish) C++ for the experienced C developer?
- zeugma 14y agoC++ Primer was updated to C++11. http://www.amazon.com/Primer-5th-Edition-Stanley-Lippman/dp/0321714113/ref=dp_ob_title_bk http://www.amazon.com/Primer-5th-Edition-Stanley-Lippman/dp/... The C++ FAQ is really helpful but doesn't seem to be updated to C++11 http://www.parashift.com/c++-faq/ http://www.parashift.com/c++-faq/ Fortunately you can refer to Stroustrup's FAQ about C++11 http://www.stroustrup.com/C++11FAQ.html http://www.stroustrup.com/C++11FAQ.html For reference (like libc manpage, basic usage, which header to include): http://en.cppreference.com/ http://en.cppreference.com/
- drothlis 14y agoIf you're coming from C, then you need to understand the STL's concepts of "Concepts", "Modeling", "Refinement", and Iterators etc: http://www.sgi.com/tech/stl/index.html http://www.sgi.com/tech/stl/index.html (that link doesn't cover C++11, nor even the STL additions in C++03 and TR1; but it is still essential background reading). When some people say "Modern C++" they mean template meta-programming (traits, partial template specialisation, etc) as exemplified by Alexandrescu's book "Modern C++ design": http://www.amazon.com/Modern-Design-Generic-Programming-Patterns/dp/0201704315 http://www.amazon.com/Modern-Design-Generic-Programming-Patt... (note that I am not necessarily advocating such techniques, but understanding them will certainly help when you run across them in the wild).
- shawn-butler 14y ago"Welcome Back to C++ (Modern C++)" while not a book is not a bad place to start (I posted the link earlier in a prior comment, sorry for the dup): http://msdn.microsoft.com/en-us/library/hh279654.aspx http://msdn.microsoft.com/en-us/library/hh279654.aspx
- jrajav 14y ago+1 for a "C++: The Good Parts". With a resource like that I might be interested in taking another look at the language.
- CJefferson 14y agoWhere are you getting these ideas from? Who are these C++ zealots you have been listening to? Certainly no-one I talk to. No-one thinks auto_ptr was a great thing. It was a tool, which could be used with care, but for years most books have said "don't use auto_ptr". Throw specifications are... throw specifications. Some people like them, over time it has turned out they don't scale too well. Java has gone through a very similar process. I don't get why you were so angry about them. I don't know why you think anyone thought export was the bee's knees, it's never been available in any of the major compilers since introduction. In particular, I think everyone agrees export and auto_ptr were bad ideas. That's what literally everyone I hear talk about them says. I don't get why you think these mistakes aren't admitted?
- saurik 14y ago(In a way this is off-topic, but I feel the need to point out that the throws() specifiers in C++ are not like Java's: they are more like a runtime assertion that "if this function throws something not in this set of types, terminate my program"; the result is a situation where you gain nothing at compile time, force an on-some-architectures-painfully-slow exception check on the function, and in the end find yourself with a very similar result to having just not caught the exception at all. This particular C++ feature was sufficiently useless as to be downright harmful. The Java feature, by comparison, has some defensible merit ;P.) To say something more on-topic: as someone who has been programming in C++ for 15 years, I agree with your comments regarding how C++'a community typically admits the things it sucks at, and is rather pragmatic about the whole thing. (You kind of have to be with a kitchen-sink language like C++ ;P.)
- betterunix 14y agoOn the other hand, when I talk about the problems with exceptions in C++, the C++ zealots come out in force. Rather than admit that C++ does exceptions the wrong way, they (a) point to other languages as having the same problem (b) claim that exceptions should not be used in cases where the problems are problems and (c) accuse you of not really understanding what exceptions, destructors, constructors, and object oriented programming are about. Rather than fix the problems with C++ exception in C++11, the standards committee further cemented those problems.