Books on C++ ------------ This file was put together by J. Clarke. Editorial comments in [...] brackets are by me. During the fall of 1998, I taught CSC270F -- a course that discusses C and C++ programming as well as data structures, simulation, etc. I'm an OK C programmer, but not an expert on C++, so I asked those students who knew about it to recommend suitable books in the course newsgroup. This file contains a summary of the comments received or posted, organized according to the book discussed. That is, this isn't a chronological record of the discussion. Here's my invitation to discuss: > ... a note to those who already know C++ and who missed that part > of yesterday's lecture: I'm having trouble recommending a good book for > your colleagues to learn C++ from. King's text isn't enough, and I find > Stroustrup's "The C++ Programming Language" a little too forbidding for > newcomers to C++. I know there are various books out there with fanatical > adherents, but I haven't read any of them myself. > > So, if there's a book you particularly liked -- or didn't like -- for > learning C++ as a second (or two-and-a-halfth) language, I invite you to > post an item to the course newsgroup about it. As I told the class, > completely uncritical praise will not likely be so convincing as more > balanced consideration, but we'll be grateful for anything. "Beginning Visual C++ 5" by Ivor Horton --------------------------------------- I have a C++ book that I think is pretty good: Beginning Visual C++ 5 published by WROX, by Ivor Horton. I have found this publisher has an excellent series of books on Java, Visual Basic, and C++. They're all easy to recognize because the cover is all red, and there is a big geeky picture of the author on the cover. Now, obviously, this is geared toward the Visual C++ 5.0 IDE (there is also one on Borland C++ by the same author), but it starts off by teaching you C++, then getting into how to use the IDE. It is also a good read with sufficient detail - not a dull textbook type of thing. [There is more discussion of Horton's book mingled with Stroustrup's in the next group.] "The C++ Programming Language", third edition, by Bjarne Stroustrup ------------------------------------------------------------------- [Obviously, not everyone agrees with me!] I strongly suggest you get yourself a copy of "The C++ Programming Language" third edition by (none other than) Bjarne Stroustrup. Stroustrup created C++ and he is god of C++. The book is a little hard to follow and may even put you to sleep, but it is, hands down, the best C++ reference book out there. The types of books you mention* usually give a very brief and incomplete [* referring to the note on Horton's "Beginning Visual C++"] "overview" of the language. In fact, the "Visual" part of those book titles strongly suggest they're trying to teach you how to use either MFC or OWL, two separate (and very fat) Windows class libraries. I guess this should be said: Stroustrup's book only covers C++, all 400 pages of it. Compare that to a "VIsual" programming book's 30-50 page "overview". Which would you rather have? [The original proponent of Horton's book replied:] Actually, I have both. I bought Stroustrup's book a few years ago. It is certainly the Bible of the language, but it is not exactly user friendly, nor is it full of useful exercises and examples for a person starting out in the language or who is at the intermediate stage. As for the book I suggested, it is NOT one of those books that gives you a short overview of C++. It teaches you C++ and THEN it teaches you the IDE. Incidentally, there are three versions of this book, all by the same author: Beginning Visual C++ Beginning Borland C++ Beginning C++ So if you don't want anything about IDE's - the last one is your best bet. As for the one I have - it hardly touches anything about Windows programming for the first 500 pages. The book itself is 1000 pages long. Anyway, here are what the first 11 chapters of the one I have covers: Chapter 1: Programming with Visual C++ Chapter 2: Data, Variables, and Calculations Chapter 3: Decisions and Loops Chapter 4: Arrays, Pointers and References Chapter 5: Introducing Structure into your Programs (Understanding functions, passing arguments, returning values, recursive function calls) Chapter 6: More About Program Structure (Pointers to functions, initializing function parameters, exceptions, function overloading, function templates) Chapter 7: A Taste of Old-Fashioned Windows (The struct in C++, then a couple of Windows topics) Chapter 8: Structuring your data using Classes (Data types, objects, classes and instances, understanding classes, class constructors, private members of a class, the pointer 'this', arrays of objects of a class, static members of a class, pointers and references to class objects) Chapter 9: More on Classes (Class destructors, sharing memory between variables, operator overloading, class templates, using classes, organizing your program code into files) Chapter 10: Class Inheritance (basic ideas of OOP, Inheritance in classes, access control under inheritance, the copy constructor in a derived class, class members as friends, virtual functions, multiple inheritance). Chapter 11: An example using classes. That covers pages 1-459. After that, it gets into MFC's, DLL's and all that Windows stuff. "C++: An Introduction to Programming" by Jesse Liberty and Jim Keogh -------------------------------------------------------------------- A good, basic introduction can be had from a book like ...: "C++: An Introduction to Programming" by Jesse Liberty and Jim Keogh (QUE Press). It attempts to introduce C++ at about the level of CSC 148. Like most books by QUE press, it's a bit heavy on verbiage, but it's a quick read, and explains pretty much everything in a gentle sort of way -- including a detailed discussion on templates, overloading, multiple inheritance, the whole C++ bit. "C++ Primer", by Lippman ------------------------ [A recommendation passed on by someone else:] >My book was by Lippman. I got the impression that he was sort of well >known in academic circles, and I think I saw his name mentioned as the >author of some paper on something interesting related to computer >science. The book was basically well organized, but I haven't read too >many others. Some books consistently point out facts that answer >questions that just have popped into your mind after reading the previous >section. The Stroustrup book was like that, but that book is not meant >for beginners. In other words, it doesn't have lots of sample programs >on how to do basic, commonly used tasks; file I/O is in chapter 21 in a >chapter called "Streams". The Lippman book is meant for beginners (I >think it's called "An introduction to C++" or something), and so is >organized properly, but I wouldn't classify it as one of those >answering-popping-questions books. [A clarification by another contributor:] The book title is C++ Primer. Beware: there are wannabe's with titles "A C++ Primer", "The C++ Primer", etc. They are not remotely close. "Teach yourself C++", 2nd ed., by Herbert Schildt ------------------------------------------------- Teach yourself C++ 2nd ed. by Herbert Schildt is a very readable book that assumes the student is experienced in c. It also provides a good description of OOP. There are lots of examples and exercises. The price on the copy that I have from the UofT bookstore is $35.95. [A comment by another contributor:] I never read it, but I read or glanced through some other books by him; in particular I read his Artificial Intelligence Using C, 1987. My opinion is that his books are great for beginners, in fact great for keeping you a beginner forever --- he talks about easy things, and never attempts to bring you to a higher level like Lippman does. He has lots of sample code for you to copy, but not enough theory or explanation of what is happening; consequently you cannot adapt his code to your own problems. University-level books in general --------------------------------- [including Savitch; Adams et al.; Lippman; Pohl] Usually books used as course textbooks in universities are a good choice. So a way to select a good book is to find out which ones are being used by universities. For example, although not a C++ course, UBC uses "Problem solving with C++" by Walter Savitch as a textbook in one of the intro. courses (see http://www.ugrad.cs.ubc.ca/spider/cs152/). Another example, the U. of Texas has a C++ course and they use "C++: An Introduction to Computing" 2nd edition, by Joel Adams, Sanford Leestma, and Larry Nyhoff (see http://www.cs.utexas.edu/users/sarvela/cs105c++/) Another school: Stanley Lippman, "The C++ Primer", 2nd Edition. Addison-Wesley, 1991. Also, Ira Pohl's books have been used by universities. Some of her (his?) books are "C++ for C programmers", "C++ for Pascal Programmers" and "Turbo C++". All these books are from the Benjamin/Cummnigs Series in Computer Science so they are better than QUE books or "Teach yourself whatever" books. "Practical C++ Programming" by Steve Oualline --------------------------------------------- I find 'Practical C++ Programming' by Steve Oualline (O'Reilly & Associates) to be a very well organized and easy to read text on how to program in C++. The layout is much like a text (simpler subjects moving on to more complex subjects), but there is also a robust (complete) and well organized index, so it also makes a good reference book. The ISBN is 1-56592-139-9, and there's a cute picture of a chipmunk on the front!