home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!microsoft!wingnut!pauljo
- From: pauljo@microsoft.com (Paul Johns)
- Subject: Re: A Fine Beginner's Book on C++
- Message-ID: <1993Jan11.222634.19826@microsoft.com>
- Date: 11 Jan 93 22:26:34 GMT
- Organization: Microsoft Corp.
- References: <1993Jan10.095448.9908@alchemy.chem.utoronto.ca>
- Lines: 30
-
- This is the one C++ book I've seen that I judge
- "not acceptable." I don't know if there's a later
- edition, but I wouldn't trust a later edition if
- there were one, frankly.
-
- That's because the edition I've seen is worse than
- shallow: it's wrong. The author has no concept of a
- copy constructor. His solution for passing a string
- object which contains a pointer to the dynamically-
- allocated string to a function by value is "Don't.
- It doesn't seem to work."
-
- He notes that the destructor for the class gets
- called twice while the constructors he wrote are
- only called once; he never explains why. That's
- because he doesn't know about copy constructors at
- all; let alone the one the compiler generates for you!
-
- Understanding constructors and destructors is
- absolutely essential for understanding how to write
- non-trivial classes. A book that misses this misses
- the core of C++.
-
- Buy a book from someone who knows how to program in C++
- instead. And if you've used this book, read a better
- book to undo the damage.
-
- By the way, I've noticed a lot of posts on here from
- people who are clueless about copy constructors: could
- this book be part of the reason why? :)
-