Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!fluke!ssc-vax!dmg From: dmg@ssc-vax.UUCP (David Geary) Newsgroups: comp.lang.c++ Subject: Re: C++ Design (actually textbooks) Keywords: Here's a review of three books... Message-ID: <2727@ssc-vax.UUCP> Date: 16 Jun 89 17:33:39 GMT Organization: Boeing Aerospace Corp., Seattle WA Lines: 140 In article <1271@ethz.UUCP>, Robert Marti writes: In article <9474@alice.UUCP>, bs@alice.UUCP (Bjarne Stroustrup) writes: + Should any of this increase your interest to the point where reading a + textbook seems worth the effort here is a selection (in chronological order + more or less): + [ ... ] + Berry, John: "The Waite Group's C++ Programming" [ ... ] + Pohl, Ira: "C++ for C Programmers" [ ... ] + Dewhurst, Steve and Stark, Kathy: "Programming in C++" [ ... ] + Lippman, Stan: "A C++ Primer" [ ... ] + [ ... ] + Can anybody out there provide further info on any of these books? + I am especially interested in how they cover the issue of object- + orientation in C++, for example, different approaches to set up + class hierarchies for various uses (tradeoffs in building container + classes comes to mind). I'd also like to know which of these books + are based on release 2.0 of C++. + Of course, I'd especially appreciate the opinions of Bjarne Stroustrup, + Andy Koenig and others involved with the C++ design and implementation + efforts, but they may be wary of antagonizing the respective authors ... Well, I'm not Bjarne Stroustrup or Andy Keonig, but I have read the following books: Stroustrup, Bjarne: "The C++ Programming Language" Berry, John: "The Waite Group's C++ Programming" Lewis & Pinson: "Object Oriented Programming and C++" Here are some subjective opinions: Stroustrup, Bjarne: "The C++ Programming Language": This book is written very much in the style of "The C Programming Language" by K&R. It is quite terse and to the point. As with K&R, you will get the most out of this book if you are an experienced programmer. Of course, this book is "The Book", meaning "the" reference for C++. This is the book I pick up when I want to know "is ... legal in C++?". Coverage of OOP: I was suprised to find that BS does not extol upon the virtues of OOP. C++ seems to be presented more as simply a "better C". BS does show the benefits of OOP using C++, but they are scattered throughout the book, and the idea of OOP is not consolidated. For example, on page 213, we find: "That style of programming is often called object based or object oriented..." (Notice the page number). You'd want this book if: You are an experienced (preferably C) programmer, and would like a good reference to the language. You should already understand OOP, and the benfits to be obtained from OOP, as they are not clearly spelled out. Berry, John: "The Waite Group's C++ Programming": This is my least favorite of the three. The code is ridden with bugs, and C++ is not covered in depth. I found the treatment of derived classes and inheritance to be somewhat confusing. Coverage of OOP: In this aspect, the book seems only slightly better than BS. John Berry discusses modularity and data hiding in C, by using an example in C, and then proceeds to show how modularity and data hiding are much better supported in C++ by rewriting the example in C++. However, nowhere in the book does JB discuss the virtues of OOP at length. You'd want this book if: You know next to nothing about C++, and want a decent intro to the language. Don't expect a thorough treatment of the subject, or expect to gain any valuable insight into OOP techniques. Expect to be annoyed by bugs throughout the code examples. Lewis & Pinson: "Object Oriented Programming and C++": (Disclaimer: I'm about 1/2 through this one) Well, this book is the best of the three (IMHO). The book (as it's title suggests) presents OOP concepts well. However, treatment of derived classes and inheritance seems to be somewhat lean. This book, more than any of the 3, contains A LOT of code. There is a chapter on Baseline classes that shows generic linked lists, etc. The book also does not attempt to present the C++ language in a complete manner. For instance, a few times in the book the reader is urged to study Stroustrup's book for a more thorough explanation of certain topics. I also am not completely enamored with the code examples given. Baseline classes left much to be desired IMHO. Coverage of OOP: The best of the 3, OOP and its benefits are discussed at length, and one gets a good understanding of OOP. One technique that I think is useful is comparing C++ code to similar code written in Modula-2, and showing the benefits of OOP in C++ as opposed to "structured" Modula-2. You'd want this book if: You already know most of the basics of C++, and are interested in the OOP aspect of the language. I wouldn't recommend this book for the beginning C++ programmer. This book should be read after the reader has a cursory knowledge of the language. Summary: Get Stroustrup's book for a reference. Get Berry's book if you feel like wasting a little money, and know nothing about C++. Get Weiner and Pinson if you want to explore the OOP features of C++ more. I would buy all of them all over again (with the possible exception of Berry's). However, I think that the best resource one can find for info about C++ is right here. Just as the Wizard of Oz told Dorothy: "You've had the slippers on all the time." OSTTE. None of the books presents topics in the depth they are discussed here on the net. Oh, BTW, none of the books mentions features present in 2.0. None of the books mentions multiple inheritance, except to say that C++ does not support it. However, I have heard that BS will be coming out with a revised version of "The C++ Programming Language". -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ David Geary, Boeing Aerospace, Seattle ~ ~ "I wish I lived where it *only* rains 364 days a year" ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~