Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this big book that basically covers all the main aspects of the C++, the problem is that is pretty old according to the C++ standards of today, it's ok to use it?

share|improve this question

closed as primarily opinion-based by durron597, enderland, MichaelT, Ixrec, GlenH7 Aug 16 '15 at 17:53

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

Far more important than which language it uses as baseline is whether it teaches using that language in ways that are now considered good. Writing "C/C++11" is worse than writing "Modern C++98". – delnan Jun 29 '12 at 22:08
It'd probably help if you named the actual book. – Caleb Jun 29 '12 at 22:23
@Caleb it's an italian book from a university professor, i do not think you know, anyway this is the book and the main topics are C++ and UML. – user827992 Jun 29 '12 at 23:12
@delan C/C++ isn't a language, and C/C++11 definitely isn't a language. There is language that is called C and there is a language called C++ which in most cases is a superset of C, but not in all cases. They are two different languages. Saying C/C++ is like saying Java/C#. – Jarrod Roberson Jun 29 '12 at 23:25
Plain and simply put C/C++ on a resume and it will get tossed in the trash quicker than you can ever imagine by anyone with any technical acume at all! It isn't a real term, it shows ignorance and lack of comprehension of both C and C++. Imagine if you saw VB6/C# or Java/.Net doesn't make anymore sense than C/C++, and shows confusion at best and total lack of comprehension at worst. Go ahead and use that term for whatever you think it means, everyone else thinks it means ignorance. – Jarrod Roberson Jul 5 '12 at 14:40
up vote 6 down vote accepted

It's fine to use it. You won't get the most up-to-the-minute information, but the large majority of C++ is the same language that it was in 1998. If you're just learning the basics, go right ahead. Just keep in mind that there have been some refinements, and look for resources that explain the differences so that you're aware of them.

Here are a few of those resources:

share|improve this answer
Not to mention that not every development shop is using the most recent compiler stack on their platform, so by sticking to "old" patterns you can work on a larger number of codebases and environments. – Jason Scheirer Jun 29 '12 at 22:02
That's not true at all. C++11 is a major gamechanger in many areas. – DeadMG Jun 29 '12 at 22:11
@DeadMG I'm not saying that the differences aren't important, but to someone just learning C++, there's plenty to learn that stays the same. Stroustrup himself wrote that although he's working on a 4th edition of his book, " is important that The C++ Programming Language (3rd Edition) describes Standard C++, its standard library, and the techniques they support... It is not suddenly going to be outdated. The billions of lines of C++ will still mostly be C++98 and will still work with C++11 compilers." – Caleb Jun 29 '12 at 22:22
@LokiAstari The OP said his book covers the C++98 standard, and that certainly includes exceptions. Stroustrup's The C++ Programming Language, 3rd ed. was published in '97 but includes both exceptions and the STL. I'm dubious that "most" books on C++98 don't cover those things -- I have a few books from that era and all cover both. – Caleb Jun 30 '12 at 0:10
If the learning is to learn the syntax, go ahead, with caution, the syntax is substantially the same with notable exceptions compared to C++11 easy to find and relatively small. I am in the boat of wanting to re-learn C++ after about 18 years away from it. As I see it, C++ today is syntactically the same (To practical purposes), C++11 a little different, But I have to learn to write "C++11 programs", not "C with Classes C++" or "C++ circa 2000" – mattnz Jun 30 '12 at 0:46

C++11 is a pretty big deal- not to mention that many books back in 98 taught C with Classes, rather than C++. I'd look for something newer. We have a question on Stack Overflow which supplies recommendations for books worth possessing.

Edit: Of course, there are also many new C++ techniques which simply did not exist previously, especially where templates are concerned, and there are some idioms which are no longer, like checking for self-assignment, not to mention global changes in the software industry like pushes for parallelism.

share|improve this answer
That's the question… – Florents Tselai Jun 29 '12 at 22:50
Note that the OP never actually said that the book is from 1998 - only that it is about the 98 version of the language. – sepp2k Jun 30 '12 at 11:06
@sepp2k - The advice is the same. The C98 specification is outdated. It is fine if that is what you need to use, but if you have a choice, learn the current specification and the differences between them. – Ramhound Jul 5 '12 at 13:49
@DeadMG Is checking for self assignment universally gone? Why? – David Jul 5 '12 at 23:48
@Dave: Because self-assignment is actually insanely rare, but you pay the cost of the check. Copying or moving the object on the rare scenario when you do self-assign is less cost overall. – DeadMG Jul 8 '12 at 13:46

It's probably better to learn the old version first:

  • It may be a while before C++11 is fully supported by the latest version of your favorite compiler. Or the compiler your particular project requires you to use.
  • Code written before C++11 won't use it. It may be a while (as in, "possibly never") before any given project migrates to C++11.
  • In order to understand the reasoning behind the design of C++11, it is probably best to understand the original form of the language.

At any rate, if you don't learn the old version first, you may have a hard time figuring out how to write for any system that doesn't fully support the new one. For that matter, I would recommend learning C first, before learning the old version of C++: it will save you many agonizing moments of "why the hell did they do it like that?"

share|improve this answer
+1 All good points. – Caleb Jun 29 '12 at 23:02
-1 - why the recommendation to learn C? the question only mentions c++ – ell Jun 29 '12 at 23:15
actually nevermind, I see you said so you don't question the reason. Although I disagree I don't think it warrants a downvote, removed. edit: sorry can't remove it now – ell Jun 29 '12 at 23:25
Yes it may be worth learning C++03. But it is definitively not worth learning C++98 (that is dead). Even books written in the early 2000's are going to be pretty horrible for learning C++03 from as the way the language is used has drastically changed. I would recommend not learning C as a stepping stone to learn C++ (learn it as its own language) but it apart from the underlying basic syntax they have nothing in common. What is good practice in C may not be good practice in C++. – Loki Astari Jun 29 '12 at 23:54

I am going to advocate learning C++11, not older versions. It's true that the large majority of the language syntax and semantics will be the same and it's true that there's virtually no C++ 11 codebases in the roughly gazillion lines out in the wild. So, yes, it's true that you're essentially learning a new and not-yet-common dialect and that may be a disadvantage if you are quickly charged with doing something with an older dialect.

But the new dialect is better and simpler. The problem, I think, is that when you do go and deal with an older codebase, you may be confused by "Why didn't they just use...?" thoughts. But the flipside is that if you learn an old dialect, as a beginner you are poorly prepared to know "Oh, okay, this template thing is replaced by a much simpler lambda thing..." and you can find yourself dealing with some really hairy-looking code.

It's true that compiler support is still patchy, but I think everyone has auto and lambdas and range-based for and support shared_ptr/unique_ptr/weak_ptr. So there's a lot of really big wins that are widely available.

(It's true, though, that if you're just using a book, you probably won't be exposed to the full glorious melange of idioms you see in a legacy codebase.)

share|improve this answer

The book itself isn't bad, but it is not a "language" book, but much more a "software engineering book".

It should not be used to learn a "language" but to learn "design techniques". The language is just a tool to implement the samples.

That said, we have to consider that in '98 C++ had a flawed template support and that many techniques where not been discovered/invented yet.

You must hence be conscious about some potential risks:

  1. The author don't speach about a technique because not yet available. This is information incompleteness, you can fill-up with a further read. Not bad by itself... but why not start with a more recent reading?
  2. The author is not (yet) aware of a potential problem a technique is teaching may have (because it has been discovered later). A bit more dangerous: if you don't fill this gap, you may be in troubles other are already away from.
  3. The author is aware of certain problems and teach you techniques to avoid/solve them. May be now there are more effective/proper ways to avoid/solve those problems, making those techniques unnecessary overhead.

Moral: when talking about C++, books that predate 2003 should not be anymore considered.

share|improve this answer
can you give me some good title? Which version of the standard you can consider a good starting point? – user827992 Jul 5 '12 at 10:37
There is a question on SO that covers suggestions on C++ books. – Ramhound Jul 5 '12 at 13:52
I have to disagree about the date. Alexandrescu's Modern C++ Design from 2001 is considered the definitive book on template-metaprogramming. Of course, when it was written, most compilers didn't even support templates well enough to use everything in it. – Dirk Holsopple Oct 16 '12 at 13:01
@DirkHolsopple: One of the things I've leaned in 30+ more year of experience is "never use the word "definitive". Andrei's work was truly the predecessor of template metaprogramming. It is certaily good about the concepts, but it requires a review about the samples, at least because C++11 syntax can greatly simplify many of them (He make a lot of mortal-jumps to allow varadic template surrogates not anymore necessary, for example!). The point is to be aware of it. You can study Andrei's techniques, of course, but I would not recommend them as today's best practices... – Emilio Garavaglia Oct 17 '12 at 8:12
... Although it is certainly true that many of today's best practices derives from Andrei's studies and publications – Emilio Garavaglia Oct 17 '12 at 8:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.