Separate an article; previously scattered book reviews were scattered in notes and tweets, and not collected in one place, making indexing inconvenient. In the future, after reading technical books, I will write some comments and put them all here. Since the subjects of the reviews are technical books, mere phrases cannot describe all the technical details. The intent of this article is not “technical notes,” but rather “book reviews,” so I won’t delve too deeply into the technical details described in the books. Instead, I will share my own reading experiences and tips as an ordinary reader. If I express any opinions about certain books, they are my personal evaluations of the books with no intention of demeaning the authors.
I have previously recommended some books: Some books and tools for learning C/C++, but I didn’t write more detailed reviews, which can serve as a simple reference. If I have time, I will provide more detailed reviews of the books I have read before. There is also Reading TC++PL, C++ Primer, and ISO C++, which details the evaluation of the three subjects.
Recently (2017.05.06), I read a few books (all related to C++), and I’ll provide a brief evaluation.
C++ Primer
This is a small book, gathering dozens of important concepts and commonly used design patterns in C++. However, due to the limited length, each entry is basically just a brief mention. Perhaps, as the author quotes Mark Twain in the preface:
A successful book is not determined by its content but by what remains unsaid.
And Einstein’s:
······ Keep it as simple as possible, but not simpler.
The author certainly accomplished these two points (2333). Almost every item occupies just one to two pages, and some items mention things that are not simple and may require more literature to fully understand, such as TC++PL
, which is a good choice. Many concepts in the book are explained from the perspective of “C++” compiler implementation, and it does not cover C++1z content, and includes features like auto_ptr
that are already deprecated
in the new standard. From the perspective of the new standard (C++11/14), the content is somewhat outdated. Moreover, unlike any book explaining C++ syntax concepts, this book merely lists some important features and design patterns in C++. If a reader is already familiar with the C++ framework, there isn’t much value in reading this book.
Overall, the positioning of the book is rather awkward: it is not tailored for beginners, but non-beginners are already familiar with most of its content, and it does not delve deeply, making it of limited practical significance. Additionally, some programming techniques in this book do not comply with C++ standards, so be cautious while reading to avoid pitfalls.
Some items overlap slightly with the content of Effective C++, but not much, and lacks the depth of Effective C++.
On a scale of ten, I would rate this book five points.
C++ Coding Standards: 101 Rules, Guidelines, and Best Practices
This book is not very lengthy either, around 200 pages, but unlike the previous one, it contains substantial content.
It covers a lot of specific analyses of C++ programming issues, mainly from the perspective of “how to write robust code in C++?” addressing various programming principles. The descriptions of entries are clear, and the examples provided are convincing, also listing exceptions for each described entry, giving it a dialectical writing style. I believe that generalized “best practices” are essentially a fallacy; there are only the most suitable best practices, not the best overall practices, as each problem requires specific analysis. This book’s writing style allows insights into problems from a dialectical perspective, not merely stating coding techniques, which is crucial. Teaching someone to fish is better than giving them fish.
The author of this book is the renowned Herb Sutter
—chair of the C++ standards committee. The content related to C++ semantics is very enlightening: Concepts that typically create ambiguous understanding are also discussed, though not thoroughly enough. If someone has not encountered these topics before, it can be easy to be confused about what is specifically discussed. Similarly, due to page limitations, many topics are only briefly touched upon. The target reader group for this book is very clear: non-beginners who hope to understand more C++ programming techniques and “best practices.” I believe a prerequisite for this book is having read TC++PL
or C++ Primer
; of course, if one can cross-reference with the C++ standard while reading, it would be the best way.
Additionally, this book overlaps with some content in Effective C++, but it is not enough to rely solely on one book, as Effective C++ provides more detailed descriptions. Books are not expensive; learning something from it is definitely worth the cost, and buying books to read is the most economical investment. However, the major issue with this book is that some problems are described insufficiently and not comprehensively, requiring exploration of other books and materials.
By the same scoring standard mentioned above, I rate this book seven points.
C++ Programming: Problems, Solutions, and Design Principles
The author of this book is also Herb Sutter
, and I believe the target audience consists of those interested in “C++ language features.” Although many principles and features are analyzed in the book, many are often not used in actual projects, but it indeed contains lots of valuable insights.
Starting with examples of C++ standard library implementations and language features, it provides design principles for coding. Unlike the previous book, which mentioned many programming concepts, this book discusses more practical C++ language techniques. However, some of the features mentioned are less common and also depend on compiler implementations. If the code in the book yields different results in your own environment, don’t doubt life or mock the book. This occurs because the book touches upon some features that depend on compiler implementations; how to discern whether a feature “depends on compiler implementation” does not seem to be thoroughly described in the book (at least not in the ones I have read, which only briefly mention it). One must refer to the C++ standards for clarity. After analyzing actual code, specific principles are listed, and it is essential to understand the underlying thoughts and pitfalls related to C++ features from the book’s earlier descriptions.
The reading prerequisites for this book are the same as above: at least familiarity with C++ syntax rules, recommended reading TC++PL
.
Moreover, the book mentions many C++ standards, but these are relatively outdated C++03 standards, and some of the issues may not be comprehensive from the view of newer standards, although most insights are still relevant and cannot be considered outdated. Particularly, the author’s perspective, as the chair of the C++ standards committee, on the analysis of C++ development and features is quite unique. Especially, the class design section can be effectively combined reading with Inside The C++ Object Model
. I personally believe this can be the recommended reading for C++ engineering techniques and in-depth exploration of principles after Effective C++
.
Using the same rating criteria mentioned earlier, I rate this book eight points.
I recommend every C++ programmer take the time to read C++ Coding Standards: 101 Rules, Guidelines, and Best Practices
and C++ Programming: Problems, Solutions, and Design Principles
because they cover many aspects of C++ language features and programming techniques that are not discussed in syntax books (TC++PL/C++ Primer). I believe these two books provide a deep understanding of C++ language features and programming techniques. The best way to read them is: if you encounter concepts in the books that are unclear, it is advisable to refer to the C++ standard for relevant descriptions; this yields the best results. As for the first book, C++ Primer
, it is optional.