Slashdot Mirror


Practical C++ Programming, Second Edition

adrienlamothe writes "Practical C++ Programming is dedicated to teaching the reader how to program in the C++ programming language. The book actually has four goals: 1) Teach the reader C++. 2) Instill good programming style and practice (indeed, the book's subtitle is 'Programming Style Guidelines.') 3) Teach the programmer basic software development concepts. 4) Introduce the reader to debuggers and the make utility. 4) The author encourages the reader to use a computer to enter, run and debug the book's programming examples. I concur with this advice, though it isn't absolutely necessary." To see how well the book meets its own goals, read on for the rest of Lamothe's review. Practical C++ Programming, Second Edition author Steve Oulline pages 549 publisher O'Reilly & Associates rating 7 reviewer Adrien Lamothe ISBN 0596004192 summary Guide to learning C++ and programming style.

Practical C++ Programming is a fairly large book: 549 pages organized into six parts containing 30 chapters and 5 appendixes. The parts are as follows:

  1. The Basics
  2. Simple Programming
  3. Advanced Types and Classes
  4. Advanced Programming Concepts
  5. Other Language Features
  6. Appendixes.
You will have to read most of the book in order to learn C++, although there are a number of chapters you can avoid if your goal is to learn only the language's mechanics.

I must start by saying that I like the book -- I think it has value. There are a number of things I really appreciate about the book. There are also some problems that adversely impact one segment of the book's intended audience (more about those later.)

The book discusses all the essential elements of C++. Areas covered include: Class definition, namespaces, scope definition and resolution, operator and function overloading, object memory allocation (i.e. new and delete,) type casting, exceptions, inheritance, templates (including an introduction to the Standard Template Library,) the Input/Output system (including the C I/O library), and pointers. All language operators are discussed (i.e. relational, assignment, etc.) Also covered are language elements that C++ has in common with C. The other areas of instruction (programming style, software development concepts, programming tools) are intertwined with the primary topic throughout the course of the book.

One of the book's strong points is the author's excellent conversational writing style. It's hard to find books that combine good technical information with clear expository writing (O'Reilly seems to publish most of them.) Practical C++ Programming definitely succeeds in this area. The author frequently references his own experience to reinforce concepts on programming style, design and debugging. I found his anecdotes useful and occasionally humorous. The book also contains small sections of text that serve to warn the reader of pitfalls (these are marked with a bear trap icon) and areas where caution should be exercised (marked with bear paw tracks). Also, some of the source code examples contain intentional bugs, which the author explains at the end of each chapter. Diagrams, tables and source code examples are found on almost every page of the book, and these are used to keep the reader engaged with the textual discourse. My favorite diagram is Figure 7-1. "Software life cycle," on page 88; I emphasize with the dinosaur.

The book contains some interesting programming examples. The chapters on operator overloading and floating-point math contain source code illustrating how to deal with the numeric precision problems that plague all computers and computer languages. The chapter on the Standard Template Library contains a program showing how to create and use objects that manage a simple roster for enrollment and grading of students. The book also contains several examples of linked-lists and trees, for the purpose of teaching the reader how to use pointers, and to also show the reader the power and usefulness of the Standard Template Library.

Now to speak about the book's shortcomings. First, although the book does a good job of covering the important C++ topics of classes, inheritance, and templates, I think it falls a bit short in these areas (especially the coverage of inheritance). Also, the terms instantiation, polymorphism and encapsulation are not used in the book. The book could have provided a bit more insight into object-oriented concepts. Also, these areas of the book are sparsely diagrammed. Second, source code errors and typos appear regularly enough to frustrate an inexperienced reader. I also found a couple of diagrams to be confusing. Third, there are occasional misleading statements that a beginner probably won't recognize as such. Because of these problems, I cannot recommend the book to people with no previous programming experience. I'm surprised that these problems made it into a second edition.

I think that despite these problems, the book has value to experienced programmers who want to learn C++. C programmers in particular will have an easier time dealing with the source code errors. Also, I think that the book can be used by beginning programmers in a classroom environment, providing the instructor understands the book's problems and is prepared to guide students around them. The book should be particularly useful when read in conjunction with a good C++ reference guide.

Practical C++ Programming is an ambitious work in its breadth and depth. It covers more areas of software development than other C++ books. It takes an interesting approach that some readers will appreciate and others may not.

I would like to have seen a more detailed and complete explanation of the object-oriented aspects of C++ (including more diagrams). A table showing all functions for Standard Template Library containers would have been nice (the book does make reference to two STL web sites). Some mention of third-party object libraries (such as Rogue Wave, Qt, etc.) and their uses would have been helpful.

The lack of a detailed explanation of inheritance may not be bad. I'm one of those who believe that heavy reliance on inheritance causes serious maintainability problems. However, I think the book should have covered this topic more fully, so the reader would understand this issue.

In summary, Practical C++ Programming is a good book that really shines in some aspects and falls short in others. With some improvement, it could be a great book.

You can purchase Practical C++ Programming, Second Edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

2 of 266 comments (clear)

  1. Factor patent abuse into the cost of Amazon books by abe+ferlman · · Score: 0, Offtopic

    Reduce their margins and they'll eventually fold or be bought out by someone less prone to abuse the ip system.

    Don't give Amazon any of your money until they clean up their act. You can afford the difference, you can't afford to overturn bad patents later.

    --
    microsoftword.mp3 - it doesn't care that they're not words...
  2. Re:Paging system broken? by DrSkwid · · Score: 0, Offtopic

    when a thread overlaps a page it reprints that thread from the parent onwards

    If you really give a shit you could always RTFS

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter