Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!pdn!dinsdale!reggie From: reggie@dinsdale.paradyne.com (George W. Leach) Newsgroups: comp.lang.c++ Subject: Re: Starting on C++ Message-ID: <1990May8.185818.9259@pdn.paradyne.com> Date: 8 May 90 18:58:18 GMT References: <4403@mit-caf.MIT.EDU> <6170019@hpindda.HP.COM> <4143@infmx.UUCP> Sender: usenet@pdn.paradyne.com (0000-USENET News Administrator(0000)) Reply-To: reggie@dinsdale.paradyne.com (George W. Leach) Organization: AT&T Suncoast Division, Largo FL Lines: 191 In article <4143@infmx.UUCP> briand@infmx.UUCP (brian donat) writes: >Having just dealt with the 'first' obstacle of finding an introductory >text on C++, I figure, that my opinion is of some merit with regard to >this thread. >I originally purchased > -Dewhurst S.C. and K.T. Stark, "Programming in C++", Prentice Hall, > Englewood Cliffs NJ, 1989 >I'd gotten into about the third chapter in this book and found myself >drowning. This is an excellent example of a book written by a couple >of people who seem to have no empathy for the person who has never seen >C++ before. Their knowledge of the language is readily apparent, I >suppose, by the examples and descriptive text, but I, the beginner, >had a hard time piecing things together because 'preliminary' building >blocks on the concepts (and REASONING for them) was not provided in >a SANE manner. Did you read the Preface and Introduction? This book does not claim to be a primer. Nor does it claim to exhaustively discuss the features of the language. It does claim to show how to use the features. As such it it probably best to first use something like Stan Lippman's "C Primer" and then follow up with this book. But I feel that you can learn the language from this book as well. Different people need different approaches. >So, I decided I needed to do some background research, to catch up on >what the authors were dumping out in the few chapters I'd read. >I purchased > -Meyer B. "Object-oriented Software Construction", > Prentice Hall (UK) Ltd, Hertfordshire UK, 1988 > -Weiskamp K. and B. Flamig, "The Complete C++ Primer", > Academic Press Inc, San Diego CA, 1990 [Experiences regarding Meyer's book deleted] It should be noted that the progression from procedural programming to data abstraction to object-oriented programming presented in Dewhurst and Stark is quite clear and the right way to go for C++. In Weiskamp and Flamig they immediately dump you into OOP with only a page or so on data abstraction. They mix up terminology from Smalltalk and C++ and for good measure they create terminology all of their own. For the poor person just getting into this they will be speaking in tongues concerning the subject. >The Weiskamp/Flamig book on the otherhand was in my opinion >excellent. In my opinion, it is not! >I can highly recommend it to the person who is just >starting in C++, even if they don't go read something theoretical >on OOP. The book is written in a clear and lively style which >is easy to read, without getting insulting like some of those >'Waite' primers do. One 'Waite' book I once read contained >statements in text from the author which seem to imply that I, >the reader, was no more than a 17-year-old in highschool needing >great amounts of hand-holding and some fatherly slaps on the hand >for screwing up. Funny, that is pretty much how I felt about this book. The tone of the book is highly informal and the attempts at being humorous are out of place. The programming examples are so contrived and at times they try to be too cute with them. In a nutshell, I don't consider it a very professional treatment. >By contrast, the only things that bothered me >about the Weiskamp/Flamig book were the fact that it is rather >voluminous, but this owes to a style, where the authors presented >fundamentals first and then reviewed and built on them in each >succeeding chapter; This approach seems to be a planned thing, >and in no way does it make me feel like I'm the stupid 'nink' >(that's short for nincompoop) who doesn't know anything about >what the authors are trying to say. The size of the book is due to (1) lots of diagrams and pictures, (2) lengthy programming examples at times, and (3) large font. It is not due to content as is the case with Lippman's book. >Matter of factly, they >assume you already are very proficient in 'C' and can hack >some rough water, if presented logically. The other bother >about their book is that there are ideed many little 'typos' in >the text (rather amusing actually). Not amusing to me. If someone pays for a book they should receive a polished product, not something that looks like it didn't get enough time in the review cycle. One typo happens to be in a very significant place,in an example (pg. 126) where the concept of virtual functions is introduced. A class is presented, followed by a derived class, however, the derived class does not refer to the base class presented in its derivation list! It refers to another base class that is not shown. Another problem with the same piece of code is apparently due to typesetting of the page. A couple string constants are split across lines in the listing, without utilizing the ANSI C string constant concatenation feature. If the reader attempts to type in this piece of code and compile it, (I tried!) s/he will be in for quite a surprise. Another minor nit is the one of the string constants presented within a printf() is missing a newline character. Some examples presented in the text have portability problems. One example class stores a two byte integer with the low and high bytes reversed. But the authors declare the data item as just int, depending upon the fact that an int is 16 bits on their machine. (a PC). An int may be something other than 16 bits on another machine. Another example, uses a string library function, strdup(), that is not part of the ANSI C standard string library, nor is it typically found in UNIX environments. Another problem was the inconsistency in the style used in examples. Example code is shown that exhibits two different styles of positioning a reference operator in a declaration. Regardless which style is preferable, consistency should be exhibited. Throughout the book the standard i/o library functions, eg. printf(), from C are used. Only towards the end of the book is the C++ stream i/o library covered. The authors indicate that they used the stdio functions throughout the book to avoid confusion and to keep from introducing too many new concepts at once. >The Weiskamp/Flamig book left me with a well rounded grip on >C++. It explained most everything, while stating differences >between V.1.2 and V.2.0 (There's also an appendice detailing >V.2.0 specifics and particularly, C++ vs. C differences. The >authors make generous use of what they call 'Tranlation Boxes' >which show what a C++ to C translator generates in 'C' code. >With these translation boxes, they provide good solid explanations >of how the C++ language achieves the OOP functionality which a >C++ programmer finds so to his liking. I thought that was fine the first time I saw it, but it gets to be a drag later on in the book when they try to explain advanced concepts in C++ and show their equivent forms in C. >The authors explain some of the rough issues of the language >as well, eg. the notion that assignment of classes leads to >a lot of data copying, etc.. I will admit that, unlike many primers, they do tackle the hard stuff and not just the easy stuff. I remember a C primer I once saw that didn't talk about pointers!!!! >You get the idea, though. Some authors have carefully considered >and empathized with the needs of their audience and some, have >just done a data-dump of what they know w. explanations and >examples. We must be talking about different audiences then. I found the W&F book too simplistic in it's approach. It is the type of book that will not be of much value after the initial learning process. The other books spoken of in this posting will be used for a long time...... >I'm reading the Dewhurst/Stark book as a follow-on >to the Weiskamp/Flamig book. I suspect I'll see other good >examples of 'technique' in there, beyond the definition of >the actual language. That is exactly what the introduction of D&S says: "This book is about how to program using C++. We discuss the details of how to use C++ features, as well as how to apply paradigms in design and implementation." >Anyway the Weiskamp/Flamig book is very very good. No it is not. It is mediocre at best. With a better review process, more realistic examples, and a more professional tone it would be adequate. >I highly recommend it. And then, I recommend such other texts >as the Dewhurst/Stark for supplemental reading afterwards. Get the Lippman book, then the other. Forget the W&F book. >And that's the experience of one person who has recently >learned both OOP and C++. Somehow, I doubt you have learned either yet. George George W. Leach AT&T Paradyne (uunet|att)!pdn!reggie Mail stop LG-133 Phone: 1-813-530-2376 P.O. Box 2826 FAX: 1-813-530-8224 Largo, FL 34649-2826 USA