on June 9, 2013
I have had the Special Edition sitting on my shelf for the past 10 years. I have always relished it, just like K&R's "The C Programming Language". Even though I don't program in either language on a day-to-day basis, I find their contents invaluable examples of how to stay in-touch with the machine.
Bjarne went all out and rewrote a good bit of this book, reusing some examples from the previous editions. I have been seeing entirely new and revised examples for the most part. I particularly like how he broke up some of the longer chapters from previous editions into more manageable parts. My only disappointment with this book are the little mistakes. Someone familiar with C++ should understand the intent, but it may confuse some. This book adds a LOT of new content and reorganized a lot of the previous content, so mistakes are understandable.
This book makes an excellent reference. I have already used it extensively to upgrade a personal project to C++11. This has been essential for replacing Boost libraries with the new standard library. If you are trying to play catch-up (like myself) it's definitely worth it. It explains move semantics, variadic templates, the new memory model and many of the new language features.
As with previous editions, not only is a good book for learning C++... it teaches a lot about good programming in general.
on May 31, 2013
Rather than reprise the strategy of the 3rd edition, an intermediate textbook that suited no-one, Bjarne Stroustrup has split his C++ textbooks into roles, "Programming Principles and Practice Using C++" an intermediate language primer for the programmer learning C++ programming at university, and this text "The C++ Programming Language" for the professional programmer, even for would be aspiring language lawyers!
There being way too many introductory C++ textbooks and primers on the market, this helps to fill the need for advanced textbooks too!
And, of necessity, a lot of explaining of the new C++ 11 features and the expanded C++ 11 STL.
Warning, to quote the author: "This book assumes its readers are programmers." The essential basics are dealt with in only a few pages, in order to give more pages to many an advanced topic. In its 1360 pages, more ground is covered than in most C++ texts. Whilst in some ways rather survey like, and short on detail, this book is terse and definitive and uses technical terms with precision. And given the authors involvement in the C++ 11 standardization process, one can be confident that the terms are used with precision!
And may I state my delight that vector bool being stored compactly remains a feature, though not implemented that way in any Microsoft compiler I ever tested ...
I'd recommend this text to third year computer science students and third year software engineering students. First and second year students would in my opinion be better off buying his other textbook, "Programming: Principles and Practice Using C++".
Whilst this text has the odd typo, these seem so few as to inspire hope that this will be a classic text for years to come ...
on June 24, 2013
A number of people have complained about the quality of the physical book, such as the binding or the paper. My copy is just fine, but I can understand how other people have been disappointed.
I worked at a bricks-and-mortar bookstore for a number of years, and learned that quality control in the manufacturing of books is VERY uneven. Sometimes we'd get a shipment of a certain title, and they'd be great; but a week later we'd get another shipment of the same title, and bindings would be cracking even as we unpacked the boxes.
Publishers typically do not print their own books; rather they outsource that task to a printing company, sometimes a different company for each press run. As you can expect, some printers are better than others. Worse, sometimes printing gets re-outsourced, giving greater opportunity for foulups.
Another concern is that nearly all books produced since 1985 have pages that are glued in, rather than sewn. This makes the permanence of the binding very sensitive to the quality of the paper, the quality of the glue, the adjustment of the machinery, and of course the care of the workers. In my own library, I have some glued-together books that have stood up under decades of use; others have disintegrated in five years.
Caution: on the average, the binding quality of a hardcover book is no better than that of a softcover. So don't assume that paying more for a hardcover book will get you a better product.
Unfortunately, when you buy an ink-and-paper book, you don't know what you're going to get.
on July 16, 2013
Apparently, I lucked out and got a decent book with decent shipping, as the quality of my copy is superb.
The C++ Programming Language (3rd Edition) and C++ in a Nutshell are my two primary go-to references for day-to-day C++ programming (and stackoverflow of course). As a primarily-embedded C/C++ programmer for over 25 years, I don't read books like this cover-to-cover. Instead, I bounce around the book to explore topics, gain deeper insight, or refresh my memory on some obscure corner of the language. Having done that now for over a month, I've come to like this new edition. Typography-wise, the 4th edition is easier on the eyes, with better use of whitespace, liberal use of navy blue for keywords and program examples, and more tables and graphics than in the previous edition. This may sound trivial, but it's not--I find the improved layout makes this edition much more accessible as a reference than the more densely-printed 3rd edition.
This edition is a significant rewrite from the 3rd edition. Obviously, it contains a lot of new material covering the C++11 additions to the language. As you would expect, there are entire new chapters on concurrency and threads and processes. However, there are also significant expansions of previous topics. For example, the discussion of the iostream 'locale' facilities occupied a little more than one page in the 3rd edition; in the 4th edition 'locale' gets an entire chapter of its own, with a much greater discussion of facets, money, and the like. Concepts like RAII are now covered in detail. Overall, my impression is that Mr. Stroustrup attempted to expand topics that are of increasing prominence today, and for the most part succeeded. In addition, one of my favorite parts of the older edition, Mr. Stroustrup's lists of programming advice at the end of each chapter, are still there, revised and expanded as necessary. Sadly, what is missing are the old 3rd edition chapters on Development and Design, and Design and Programming. Not only were these sort of a condensed Peopleware: Productive Projects and Teams (3rd Edition) that I enjoyed reading, they also allowed the word 'moron' to appear in the index of the 3rd edition--a word that is now gone from the index of the 4th edition, but still applicable on many product teams :-)
My only complaint with this new 4th edition is that it truly does represent C++ 'moving on'. There is no delineation in the text between C++11 additions and the earlier language constructs. As Mr. Stroustrup mentions in the intro, this is a deliberate choice on his part to present C++ as an "integrated whole, rather than as a layer cake". The old 3rd edition Appendix B "Compatibility" is now Chapter 44, "Compatibility", and the list of changes is presented there. I would have preferred that Mr. Stroustrup would at least have put margin bars in those places where C++11 changes occurred. Not everyone is running the latest GNU desktop compiler; in the embedded world in particular change comes slowly, and some of the C++11 changes are subtle enough that you might occasionally believe an example would work until the compiler informs you otherwise.
Overall, I consider this an excellent reference to C++, more accessible than the previous edition, updated with the latest techniques, and with better coverage of contemporary topics. That said, I also intend to keep my 3rd edition around for a while longer, as a lot of the sections pertaining to dealing with older compilers and interfacing with older libraries did not make it to this new edition. As management likes to say: 'let them eat (layer) cake'.
on June 11, 2013
I'm still early in the book itself, so I can't say much about the quality of content, except that I am impressed with what I've seen so far.
However, there is one glaring problem: this 1300 page tome simply isn't constructed to bear its own weight. I've just started working through it a few days ago and despite treating the book with great physical care, it is already falling apart. The binding (what little there is) was already detached upon arrival and chunks of pages are already in danger of falling out. It's going to need some ugly hot gluing action to have even a change of staying in one piece. A book of this size and weight simply needs to be better constructed.
on November 22, 2013
If you liked other Stroustrup C++ books this one is consistent. I find having to read and re-read a section of interest so many times before reaching a mental model sufficient to begin coding I wonder what meds the author is on, e.g., 28.6 Variadic Templates. However, the book is very complete and an excellent reference. The electronic form is available elsewhere (if not now on Amazon) for less than hardcopy and greatly improves finding a topic mentioned in multiple chapters.
on August 23, 2013
C++ Programming Language, 4th Edition is a very long book of 1346 pages and quite small print. It is a complete presentation of the C++11 programming language, including the standard library. I have owned over 500 technical books, and this is a very good presentation. If you are serious about C++11 programming, then I believe this book is essential for you to own. I recommend buying the hardcover version, because you will be referring to this book for many years into the future. The presentation is somewhat like a reference manual, but it goes much farther with detailed discussion on semantics. In the hands of a C++11 professional, this book will be invaluable. But please note this book is not written for novice programmers. It assumes you know how to program and presents the C++11 standard language and library succinctly. If you are an accomplished programmer in other languages and accomplished at assimilating information, then this book would be appropriate to consider. If you are a novice programmer, you should buy an introductory book on C++ and purchase this one once you have assimilated the fundamental concepts of C++.
The book presentation elaborates on the syntax and semantics of the language and library. And you get all the expert commentary you'd expect from Bjarne Stroustrup. But this is not a cookbook of code examples to accomplish specific tasks. It is entirely focused on how to effectively use the language and the library. There are problem sets for each chapter available online. And of course, you can find endless code examples using google as well. This book focuses entirely on the syntax and semantics of the language and library constructs. It does what it does very well, leaving the rest up to you. The book presentation also references the C++11 standard extensively, which is very helpful to someone needing more clarity. This book has proved to be exactly what I was hoping for when I purchased it. In my eyes, this book deserves a 5 star rating, with the caution it is not intended for programming novices.
on October 16, 2013
First, this edition of the book is _much_ better than its predecessors in terms of organization and explanations.
However, I have dinged the book hard (minus 2 stars) because the small code snippets are plagued with typographical errors and outright careless mistakes. This leads to constantly questioning whether what you are reading is in fact correct or not. It makes an already difficult language even harder to learn. For the money, and for a hardbound book that is supposed to be a definitive reference, this lack of attention to detail is unacceptable.
on November 28, 2014
The only C++ reference that is worth considering.
If you are a C++ programmer, you need this book as a reference in order to understand the language and the intent behind some of the features (especially the new C++11).
I don't think this book is a starting point for beginners that want to learn the language. Who want to read 1000+ book when they just want to get started. I got put off by the 3rd edition when I started programming C++ and came back to it later. Use "A Tour of C++" from the same author to get the gist of the language and come back to this book once you are more experienced with the language. I also found the 4th edition to be clearer and better presented than the previous edition.
Finally, I will restate an advice I found useful from the C++ isofaq, whatever language you want to learn, there is 3 types of books you must have:
- 1 reference book to present you what is legal in the language
- 1 advice/rule book to present you what is moral in the language
- 1 example book
In my opinion the definitive C++ reference book is Bjarne book. You may not need it now but you will come back to it once you matured in the language, and when you really want to understand the feature you are using.
on July 31, 2014
I programmed professionally for 14+ years primarily in Microsoft languages but never touched C or C++. Began looking at some simulation technologies in 2009 and 2011 and ramped up on C++98 and C. Learned them well enough to produce results. C++11 came out and I did not give it much thought as I had already invested much in an established version (including the STL for C++98 and C-Style programming). After significant time reviewing books and materials in the context of C++98 from Nicolai Josuttis, Bjorn Karlson, and others, starting again with C++11 was not desirable. As C++ versions tend to be long lived and stable, I think that is still a good perspective.
I have seen articles about improvements to rvalue references in C++11 and other statements from others regarding lambdas in C++11. In other places I have seen statements about how C++11 can improve the way code is written. None of that convinced me that there was an urgent need to understand C++11. Then I read a book by Artur Moreira called SFML Game Development in which he adopted many features from C++11. I am not a game developer, just researching cross platform graphics. Artur Moreira used C++11 quite effectively in his book and I thought that perhaps I should plan on reviewing C++11. When I saw several conventions of which I was unfamiliar while reading Artur Moreira's book, I decided it was time to review C++ all over again.
C++11 introduces some useful concepts such as universal initializers, reference counting, and other concepts. Some of us know these concepts from our use and exposure to other languages. Microsoft C# has the concept of a foreach applied to interfaces of IEnumerable. It is similar in C++11 but presented differently. Rather than a foreach keyword with operands divided with an in operator, you have a for keyword with a : operator applied to a type with a pair of begin/end functions. I understand these concepts and can accept the syntax, but it aids productive use of these concepts to understand how they function in a concrete way as well as the philosophy associated with their use in the context of C++11.
That brings us to Bjarne Stroustrup who wrote this book, C++ Programming Language 4th Edition. If anyone is going to explain the philosophy of C++11, he would be the top candidate. He invented C++. There are examples in the past of inventors who could not explain well their inventions, but Mr. Stroustrup is the exception. Perhaps due to his long, long history of writing and lecturing, in addition to his active participation in technology he explains theory and reality quite well. I have read some of his books from 10 or 20 years ago such as the Design and Evolution of C++ and maybe an earlier version of this book. I found his older books difficult to read and very obtuse. His writing in this book has shifted 360 degrees in which his words are in a fresh, contemporary style that is clear and candid.
The most important benefit you gain from reading Bjarne Stroustrup's book is that you gain the perspectives, best practice, and preferred conventions for C++11. He gives advice and calls out common errors and where you might want to focus to have the code come out in a better way. You are NOT learning what is new in C++11 versus C++98. Instead, he is presenting C++ in the way it is today. This is important because you are not jumping back and forth conceptually between C++98 and C++11. He shows C++ in its new form in a complete and coherent way. This way, you can relearn C++ from a book that ties all the most appropriate parts of the language from start to finish. You can still keep the old ways in the back of your mind if you ever need them but he does talk about these things when necessary such as C-style casts (which I still use) versus using the bracket notation to convert type.
His tone is very appealing. He does not speak about C++ dogmatically nor does he speak as if all is perfect. Rather, he proceeds through a presentation of C++ that unwaveringly emphasizes the right choices and considerations while admiting when some recommendation may not hold. The best example of that is in his discussion of the universal initializer. He makes an excellent case for the universal initializer, which I plan to use to maximum effect when I finally decide to enable C++11 compiler flags, but he also reveals ways in which the "universal" initializer may not be so universal. That candor makes the text much more valuable as it prepares one's expectations for what they may realistically expect in conforming compiler implementations of the C++ language.
Again, I admit that I did not enjoy Mr. Stroustrup's books from 10 or 20 years ago. I reluctantly accessed this book because after a 1 year break from writing any C++ in my leisure time, I needed to look up some things. I thought I would just use this book plus Nicolai Josuttis' latest book on the STL as reference. I am still writing C++98 centric code and so the books as reference was somewhat less useful in some areas. However, as I referred more to this book from Bjarne Stroustrup, the writing style was so different and the explainations so much more clear that I was much more inclined to stop what I was doing and review the text in more detail. I decided now is the time to relearn C++ as there is now a guide that shows the way from start to finish.
On that note, his book is a great manual on software development today. Even if you have experience, he describes a set of ideas in a way that if you thought about them more, you would produce much better software. He goes into the different types of programming styles (OO, procedural, generic, etc) and into low level versus high level providing presenting his point of view out of his extensive experience in languages, programming, and technology. He spends a tremendous amount of time on abstraction, structure, and code elegance through proper code definition. After reading his book you will definitely advance in your perception of software code.
Me ... I am not a C++ programmer but someone with a professional background in software code who moved into C++ occassionally in my spare time in order to understand certain things in computer technology at a deeper level. C++ is in my toolbelt and I thank Bjarne Stroustrup for making it a more useful tool by way of understanding. I still do not recommend C++ for normal IT work, websites, and line of business systems better served by quick shift tools like Microsoft .NET and Java applied to frequently evolving circumstances. Rather, C++ is a language you can learn if nothing else but to better your cognition in the construction of code and the design of systems defined by code. The design and logical insights in this book are hugely valuable and he writes in a way where the concepts presented are digestable if you have any programming experience. You just need time and attention. C++ seems to have evolved well. It feels cleaner and more streamlined than even Microsoft C#. Admittedly some aspects of C++ remains inaccessible to entry level programming as part of a larger team and that is okay. Such things are necessary tools for more finely calibrating code in ways not needed in conventional IT (web systems, databases and batch jobs). I once perceived C++ as a low level tool with high level mechanisms. Bjarne Stroustrup has changed my perspective to see C++ as potentially a master language that works best when you understand it the right way.