- Shopping Bag ( 0 items )
Understanding The True Semantics of C++
Stanley Lippman is a very popular name in the C++ community, in particular because the author of this book has also written the bestselling C++ Primer (now in its third edition), which I consider one of the best companions to Stroustrup's The C++ Programming Language, and because of his activity as the editor of the well-respected C++ Report magazine.
In this text, Stanley analyzes the language from a very different perspective compared to his other excellent book: The reader is supposed to possess a good working knowledge of C++ and have some real practical experience in his/her curriculum before approaching the first page. From this level s/he is taken to real mastery of the semantics of the complexities of the language, which reserves a lot of surprises and hidden dangers to even the most skilled engineers. Almost all of the fundamental building blocks are dissected, put in a historical perspective, and explained with precision in a surprisingly easy-to-follow way.
I am convinced that much of the clarity evident even in the most intrinsically complicated passages is due to the author's choice of giving very little for granted prior to starting a thorough discussion around a tough point. This manual will surely be of little help to a neophyte, but just as surely one needs not belong to a panel of experts to benefit from its observations, because the level of complexity never gets too deep without having spent some pages of prior accessible contextual information to get everyone up to speed.
Inside the C++ Object Model is aimed at those developers who routinely use C++ but feel the discomfort of not really knowing the underlying weight of many common operations they perform or constructs they peruse. A particularly fit subset of these programmers is made up of the hardcore plumbers who pay their bills writing C++-based programming tools and libraries, or those who assume the uneasy role of the "official code optimizer" in a medium-to-large development team. Each of these programmers are going to immensely appreciate the intensive coverage of the object-oriented features offered by the language, their run-time overhead (in terms of execution time and binary size), and their influence in compilation times. This knowledge constitutes a major aid when it comes time to decide whether a certain language feature fits your needs without breaking your requirements. Moreover, along the way the text is sprinkled with interesting anecdotes explaining why certain common myths regarding C++ are nothing more than unfounded rants.
The topics and comparisons filling up the chapters are always concrete and never exceedingly academic. For example, the old C-style data manipulation is compared side-by-side with the modern encapsulation methodologies promoted by OOP, which involves inline accessors and mutators. Another chapter deals with the tricky semantics of construction and destruction, dedicating a fair amount of room to the exact circumstances that trigger the execution of constructors, destructors, copy constructors, and conversion operators. This leads to the treatment of the delicate topic of the automatic creation of temporary variables by the compiler.
Moving on, of particular interest to me are the sections focusing on the cost of virtual functions (to achieve polymorphism) compared to static-bound methods, as well as the section discussing various facets of multiple inheritance.
There are very few aspects of this book that do not deserve praise. One of them, by far the least important, is the design, which I would have preferred to be more dynamic, thereby simplifying the jumps from one point to another (which makes sense considering the typology of the contents).
The real drawback of Inside The C++ Object Model is that it is dated. Most of what Stanley says still holds true and is informative, but the language has evolved a lot since its 1996 incarnation, when the manuscript was first sent to the printers. Consequently, many of the newer features, despite their undoubted load of semantic insights and potential misconceptions, are not even touched. Namespaces are entirely forgotten, and even such crucial relatively recent elements like exceptions, templates and run-time type information receive far less coverage than they deserve. Now that the ANSI/ISO C++ committee has agreed on a final standard, I really hope Lippman will decide to take the time to update and expand his already admirable work.
— Davide Marcato, Dr. Dobb's Electronic Review of Computer Books