C++ Misfeatures Based on Experience [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
Recently a colleague asked my opinion on the use of exception specifications in C++ code, and I was able to dredge up this article by Herb Sutter: A Pragmatic Look at Exception Specifications. The article, like most by Herb Sutter, is an educational read, but the short answer is "don't do that."
In the summary, he makes reference to a poem entitled "Twas the Night Before Implementation", wherein, effectively, a standards committee bows to the demands of users to add a feature at the last minute, only to discover that while it does what was asked for, it doesn't really do what they wanted. And yes, exception specifications fit that bill. As he says, "The feature seemed like a good idea at the time, and it is just what some asked for." If that is not enough, he then visits ''export'' with similar sad results.
So the question is this: What 'feature' of C++ turns out to be broken, and should not be used, if you do not wish to experience tears. This may be prey to subjective bickering, but I hope people will cite a specific experience where the feature was deployed only to cause measurable problems. Even better would be citations of articles by leading lights like Sutter (or anyone deeply involved in the Standard) warning people off of a feature.

If you include library features as well: auto_ptr. It has its uses but it's also easy to misuse. The next C++ standard will deprecate them as well in favor of the safer and more flexible std::unique_ptr.

Related

Does reading a c++ 11 book requires to have knowledge of c++98? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am currently reading a C++ book written in 2000 which basically means is using c++ 98.(correct me if I am wrong)
My question is, reading a c++11 book like this one (https://rads.stackoverflow.com/amzn/click/0321563840) which most of the users suggest, requires me to have read already a c++98 book?
C++11 is not a separate language. It's just a new version of the existing one. Reading a C++11 book requires whatever prior knowledge that the C++11 book says it requires.
Bjarne's new version of "The C++ Programming Language" expects no prior knowledge of anything. Some other books will expect prior knowledge.
Actually, given the changes from C++98 to C++11, I'd recommend not reading an old book beforehand.
This is because a lot of old methods and idioms have been replaces with much neater constructs and features, which avoid many pitfalls and issues that C++ programmers had to contend with earlier. A coarse comparison would be to read up on relays and electron/vacuum tubes in order to, eventually, understand how to build transistor based logic. No need to start at that end.
So, I recommend you want to read on what's current, then it wouldn't hurt to read an older book to understand why a lot of already existing C++ code was written like it was.
If it's an "what's new in C++11", then you obviously need to know C++98 beforehand.
But as #Nicol says, the book should declare what previous requirements it has.

When will ranges be included in the c++ standard? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I could find two proposals to include ranges in C++:
N1871 is fairly old (2005), and N3513
However I could not find anything about ranges in the current C++14 draft (N3690). Does this mean that it will not be part of C++14? If that is the case, why is it so cumbersome to introduce ranges?
Does this mean that it will not be part of C++14?
Yes, indeed it will not be part of C++14. Unfortunately, nobody cared enough to work on a proposal.
If that is the case, why is it so cumbersome to introduce ranges?
Hard to tell. Sometimes the reason is that different people have different expectations on what should be standardized and how (see modules or concepts), and sometimes it is just because the feature is more complex to formalize than urgent.
Also, what most often happens is that Boost libraries are taken as an experimental, proto-standard implementation; and while there was enough experience and common consensus on libraries such as Boost.Thread, Boost.Function, and Boost.Bind - so they got standardized quite smoothly - not everybody is satisfied with Boost.Range, mostly because of its lack of an extensive, high-level support for functional programming.

Is "Accelerated C++: Practical Programming by Example" still current? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need to learn C++. Because I like the book's concept and I can already program in several other languages I thought "Accelerated C++: Practical Programming by Example" would be the best choice. However, the book is over 12 years old. Is it still a good idea to pick it up or would I be missing too many important new features of the language?
It remains one of the best books around. It's based on C++98, but C++03 is more bug fixes than anything else, and most programmers can't use anything more recent anyway. As with most languages that have been around for awhile, recent evolutions can be thought of as either fine tuning, or additional features to handle new issues (like threading).
I read some C++ books, and i recomend C++ Primer.
The way the author teaches the language is very insterestig.
Besides its a "heavy" book, you can learn more deeply the language and how to avoid errors.

Any good C++0x overviews? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I teach C and C++ and I was just wondering if there are good overview of the C++0x features.
I am going to read the standard, but that will take time and I'm definitely going to make it for this semester (next year hopefully). For this semester I just want to make one extra lecture about C++0x (and maybe make sure that none of the taught features are deprecated/changed in C++0x).
The best two I know of are the Wikipedia page and Stroustrup's FAQ.
I really wouldn't recommend reading the standard until you know what you're looking for. Besides being significantly larger than the C++03 standard, the organization and clarity has gotten somewhat worse in parts.
If you're only going to do one lecture on "advanced C++", you might focus on C++0x features which were adopted from other common sources, such as boost::smart_ptr and std::tr1::unordered_map. Such things are ahead of the curve on adoption.
Herb Sutter has written many articles on the changes which you might find useful.
Wikipedia has a long overview. I would hightlight rvalue references and lambdas.
There is a lot of overviews C++0x in a network. I can recommended to read a wiki page, and C++0x FAQ
I've been reading this Code Project overview:
Explicating the new C++ standard (C++0x), and its implementation in VC10
The C++ Annotations have everything available in gcc 4.4. This is a (free) book rather an overview.
Scott Meyers has a 3-day course titled "An Overview of the New C++ (C++0x)", and perhaps more interestingly, a ~335 page, $30 PDF with all the course notes (if you can't spare the time or money for the course).
I know the time & cost of the course might be prohibitive, but the PDF might be an option.

Does anyone know free C++ assessment tests online? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Does anyone know of free C++ assessment tests?
I would like to practice my C++ skils before interviews. Brainbench used to have it for free; now they want $49.99 and I think it's rip off..
Most of those "C++ questions" and pay-for-view packets are a ripoff and often a scam.
If you are interviewing at a big company, explicitly Google their name and c++ interview questions. Enough people post the interview questions online, and these companies are way too lazy to actually change this question set. Examples include Google, Bloomberg, and others.
If you want to ace interviews that ask about c++ corner cases, consider the c++ faq or the C++ faq lite (http://www.parashift.com/c++-faq-lite/). It's not questions, but it's the most valuable C++ resource IMHO.
And if you don't use C++ on a day to day basis, try to write some code and compile. I was humbled after too many years of Java to see how much of the syntax is no longer natural to me.
You might want to try My CPP Quiz as that has a set of very comprehensive C++ questions. If you can get through those easily you could consider yourself having a satisfactory understanding of basic C++.
http://www.mycppquiz.com
There is plenty of algorithmic problems to solve at SPOJ. Some of them are straightforward, well known algorithms implementations (see also The Problems classifier) some are harder. The online judge service will check your code's correctness online.