home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18969 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.5 KB  |  41 lines

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