9 of 9 people found the following review helpful:
4.0 out of 5 stars
The author is fun, the book is interesting., May 31, 2000
This review is from: C++ for Real Programmers, Revised Edition (Paperback)
This is the a unique book I've read during my life. Its style is exceptionally relax.
It discusses some confusing c++ syntax and three special themes: indirection (smart pointer etc), homomorphic class hierachies (multiple dispatch, envelope-letter idiom) and memory spaces (reference counting techniques and relateds classes).
Some chpaters are especially intersting, for example:
Chapter 8 about collections, cursors, and iterators, the cursor idiom was also discussed in <<More effective c++>> as proxy, here, it is treated as kind of smart pointer.
chapter 9 about transactions, which discussions how to implement this important feature with brillang pointers (variation of smart pointer)..
I agree with the customer from Princeton, USA that the book is out of date & contains mistakes, for example
It uses old-style casts, is not const-correct (rarely use const member functions), doesn't make any reference to the standard library. It does not use protected instead of public when defining a class used for base class only (page 78, class UnsafeNode). Other detail errors: for example, on page 100, the name of the template used is Ptr, and the template defined is SP; on page 156, class ArrayOfFoo contains member Foo** contents, constructed by contents(new Foo*[size]), and the destructor should be delete[] contents and not delete contents.
Some important design errors, for example, on page 108, you see a template SPOS (stands for "Smart Pointer for Object Statistics").
class Counter { ... public: int conversions; int members;
};
template <class Type> class SPOS { private: Type* pointee; public operator Type*() { pointeee->conversions++; return pointee; } }
It's better to hide data "members" and "converions" in private section of Counter, and define increment functions for conversions++ and members++.
It is not exception safe, as almost every c++ book, except <<Exceptional c++>>, for example, on page 119, we see
template class<class Type> class MP { private: Type* t; public: MP<Type>& opertor=(const MP<Type>& mp) { if (&mp != this) { delete t; t = new Type(*(mp.t)); } return this; } }
We should replace delete t; t = new Type(*(mp.t));
by (no self assignment test!)
Type *tnew=new Type(*(mp.t)); delete t; t=tnew;
Why? consider what happens if you delete t and an exception was thrown during t=new Type(*(mp.t)).
For this class, we can also consider reference counting to avoid copy, see <<More effective c++>> for a deeper discusion.
Overall, this is a good book, but not must have. You can read <<More effective c++>> and <<Advanced c++ styles and idioms>> instead, but reading this book really will open your eyes, since its point of view is different and sometimes it's deeper. Concentrate on its interesting ideas and pay attention to its potential mistakes.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
2 of 2 people found the following review helpful:
4.0 out of 5 stars
Exceptionally fun book, December 11, 1998
By A Customer
This review is from: C++ for Real Programmers, Revised Edition (Paperback)
Jeff's book isn't a tutorial, design handbook or step-by-step guide for C++ users, rather, it's an entry point into the C++ "Twilight Zone". It makes you think about C++ in completely new and exciting ways. I liked the book so much that I recommended it to all the members on my development team.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
2 of 2 people found the following review helpful:
5.0 out of 5 stars
Terrific in depth explanation of advanced C++ techniques, October 8, 1998
By A Customer
This review is from: C++ for Real Programmers, Revised Edition (Paperback)
A worthy addition to my C++ library. The fact that Meyers and More Meyers are truly worthy of their universal acclaim, doesn't detract, in the least, from the value of this extremely well written text. This book is aimed at competent C++ programmers who want an in depth look at the motivations behind and the ramifications of a few well chosen C++ mechanisms. The comprehensive treatment of topics such as smart pointers and memory management offers a great introduction to the potential behind the somtimes exasperating scope of C++. Jeff Alger provides a real service for his target audience. Bravo... And Thanks.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No