Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Books Media Software Book Reviews IT Technology

Practical C++ 307

jsight writes with his review of Rob McGregor's Practical C++, published by QUE. He writes "Some books attempt to do one thing really well, and others attempt a little of everything. This book is clearly an example of the latter, in full force. Weighing in at a hefty 900 pages, you would expect this book to be crammed with chapters and details on every aspect of the STL and basic C++. In the following review, I am going to cover where it succeeds in doing this, and where it fails." (This book has been out for a few years; what books would make more sense today for a C++ learner's library?)
Practical C++
author Rob McGregor
pages 900
publisher QUE
rating 7/10
reviewer Jess Sightler
ISBN 0789721449
summary Provides a practical guidebook to learning C++

Section I -- Programming 101

At first glance, the book appears to be written for people with experience programming, however reading through this section clearly dispels that myth. Here we have a section which goes over everything from for loops to if conditionals while simultaneously using verbose, duplicitous language at every step. Perhaps this was intended as a means of reinforcement, however, it seems most of the effort here would be wasted.

The technical depth is what you would expect for a novice, but without enough hand-holding and examples to make a novice feel comfortable. Making matters worse, there are numerous typos in this section, including quite a few in the examples (making them uncompilable without corrections). Some of these appear to be type-setting errors, however, there are enough to potentially confuse novice developers.

I believe that the combination of weak examples, and significant typographical errors are strong enough to give a novice much difficulty in learning the C++ language.

Having said that, the section should be provide no difficulty for any programmer with a good knowledge of any vaguely similar language (eg, Perl, Java, PHP, etc).

Section II -- Beyond the Basics

Ah, now we're getting down to Brass Tacks... this section goes over everything from Function overloading to Structure and Unions. The section on function members within structures also does an excellent job of preparing the reader for the upcoming introduction of Object Oriented concepts.

The sections on Memory management, both from an allocation standpoint, and from a bit manipulation standpoint are first-rate. Details are perhaps not as strong as they could have been, however the material is very accessible, and clearly described.

Probably my only complaint with this chapter is the overly general section on compiling and debugging programs. However, as this book does attempt to be somewhat compiler/debugger agnostic, this is forgivable. From here, we dive into the real power of C++, Object Orientation.

Section III

From the beginning, this book treats Objects as an extension of the structure syntax taught previously (with the default of Public switched to Private). This, along with the classic Plans vs. Product description of the difference between a Class and an Object are quite clear and robust.

Again, this is a solid chapter, describing the details of getting a system of classes up and running, as well as some sample data structure implementations.

And then finally, the last section is a slightly less than 200 page description of the STL. This section is probably the book's weakest part, as it is just strong enough to give you a taste of what is available, but often not strong enough to grasp the details. It's a good start, but much more attention should have been made to this subject (potentially even at the cost of some of the wasted words on how a 'for' loop works). It makes a decent introduction for someone with very limited STL background, however, there is not enough depth to reach a strong level of understanding here.

Summary

Overall, this is a solid book for an existing programmer to pick up C++ concepts. A programmer with a strong knowledge of an existing procedural language (such as C) would have no trouble digesting the concepts of this book. Having said that, the poor typographical issues, and verbose wording often muddle an otherwise good book.


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

This discussion has been archived. No new comments can be posted.

Practical C++

Comments Filter:
  • out of stock? (Score:5, Informative)

    by fjordboy ( 169716 ) on Wednesday February 18, 2004 @01:26PM (#8317143) Homepage
    Contrary to what the article and link said, I don't think you can buy it (new) on bn.com. However, it is available here at amazon.com [amazon.com] for 20.90 new or 9.00 used. Just fyi...
  • by Anonymous Coward on Wednesday February 18, 2004 @01:26PM (#8317150)
    Can anyone offer a mirror?

    Section I -- Programming 101
    At first glance, the book appears to be written for people with experience programming, however reading through this section clearly dispels that myth. Here we have a section which goes over everything from for loops to if conditionals while simultaneously using verbose, duplicitous language at every step. Perhaps this was intended as a means of reinforcement, however, it seems most of the effort here would be wasted.

    The technical depth is what you would expect for a novice, but without enough hand-holding and examples to make a novice feel comfortable. Making matters worse, there are numerous typos in this section, including quite a few in the examples (making them uncompilable without corrections). Some of these appear to be type-setting errors, however, there are enough to potentially confuse novice developers.

    I believe that the combination of weak examples, and significant typographical errors are strong enough to give a novice much difficulty in learning the C++ language.

    Having said that, the section should be provide no difficulty for any programmer with a good knowledge of any vaguely similar language (eg, Perl, Java, PHP, etc).
    Section II -- Beyond the Basics

    Ah, now we're getting down to Brass Tacks... this section goes over everything from Function overloading to Structure and Unions. The section on function members within structures also does an excellent job of preparing the reader for the upcoming introduction of Object Oriented concepts.

    The sections on Memory management, both from an allocation standpoint, and from a bit manipulation standpoint are first-rate. Details are perhaps not as strong as they could have been, however the material is very accessible, and clearly described.

    Probably my only complaint with this chapter is the overly general section on compiling and debugging programs. However, as this book does attempt to be somewhat compiler/debugger agnostic, this is forgivable. From here, we dive into the real power of C++, Object Orientation.
    Section III

    From the beginning, this book treats Objects as an extension of the structure syntax taught previously (with the default of Public switched to Private). This, along with the classic Plans vs. Product description of the difference between a Class and an Object are quite clear and robust.

    Again, this is a solid chapter, describing the details of getting a system of classes up and running, as well as some sample data structure implementations.

    And then finally, the last section is a slightly less than 200 page description of the STL. This section is probably the book's weakest part, as it is just strong enough to give you a taste of what is available, but often not strong enough to grasp the details. It's a good start, but much more attention should have been made to this subject (potentially even at the cost of some of the wasted words on how a 'for' loop works). It makes a decent introduction for someone with very limited STL background, however, there is not enough depth to reach a strong level of understanding here.
    Summary
    Overall, this is a solid book for an existing programmer to pick up C++ concepts. A programmer with a strong knowledge of an existing procedural language (such as C) would have no trouble digesting the concepts of this book. Having said that, the poor typographical issues, and verbose wording often muddle an otherwise good book.
  • Guilt (Score:3, Informative)

    by Anonymous Coward on Wednesday February 18, 2004 @01:26PM (#8317158)
    Guilt free purchase link [powells.com].
  • I concur (Score:5, Informative)

    by gregarican ( 694358 ) on Wednesday February 18, 2004 @01:26PM (#8317159) Homepage
    This book has been in my reference shelf for awhile now. Some areas are emphasized more than others -- arrays more than vectors, structs more than classes -- but overall it's a good companion.

    In terms of going over bit manipulation, memory addresses, pointers, etc. it really goes into detail that I wouldn't expect for an entry-level reference. Then again it's so thorough it really isn't just an entry-level reference!

  • Best learner's C++? (Score:5, Informative)

    by FortKnox ( 169099 ) on Wednesday February 18, 2004 @01:29PM (#8317207) Homepage Journal
    (This book has been out for a few years; what books would make more sense today for a C++ learner's library?)

    Best learner's C++ book has to be "Thinking in C++" by Bruce Eckel. I always touted his "Thinking in Java" as the premier book for the learning java developer, but his success started with TiC++. Best of all? Its available free electronically [bruceeckel.com] on his website (but I always went out and spent the $30 for the paperback version to support him).

    If you pick up the book, you'll understand the language just a little more. He writes the book just how you'd like to learn, not like some math book that blandly gives out information in a manner that puts you to sleep. You can thank me later after reading it ;-)
  • by sczimme ( 603413 ) on Wednesday February 18, 2004 @01:29PM (#8317212)

    From the review:

    Here we have a section which goes over everything from for loops to if conditionals while simultaneously using verbose, duplicitous language at every step.

    Umm, you do know that duplicitous means "Given to or marked by deliberate deceptiveness in behavior or speech", right? Or did you mean redundant?

    (The quoted definition was provided by http://www.dictionary.com.)
  • The one I used (Score:4, Informative)

    by proverbialcow ( 177020 ) on Wednesday February 18, 2004 @01:31PM (#8317231) Journal
    My C++ class used "Object-Oriented Programming Using C++" by Ira Pohl. The language was easy to understand, and it was aimed at people who'd done some coding, though it was necessarily a prerequisite. He somehow managed to make the subject accessible to newbies without condescending. A great book for beginners, and since I don't use C++ on a day-to-day basis, I find myself picking it up now and again.
  • by ArmorFiend ( 151674 ) on Wednesday February 18, 2004 @01:32PM (#8317240) Homepage Journal
    I am in the market for this type of book, however, the one I have my eye on is:

    The C++ Programming Language (Special 3rd Edition) [amazon.com]
    by Bjarne Stroustrup

    A reference is too hard too read, but this looks like it might be the right level - hopefully pretty steep, but with some language design chit-chat thrown in. What do others think of this book? (And what languages have you learned, a VB for dummies alum isn't going to give the same advice as Guy Steele)
  • by xiox ( 66483 ) on Wednesday February 18, 2004 @01:35PM (#8317269)
    An excellent book is Accelerated C++ - Practical programming by example (Koenig & Moo). It only weighs in at 340 pages, but really helps the beginner to use things like the STL. It doesn't start off teaching basic C, but leaves pointers out until much later, and concentrates on using the STL data types.
  • by prostoalex ( 308614 ) on Wednesday February 18, 2004 @01:43PM (#8317352) Homepage Journal
    This book is available on Safari [oreilly.com] for subscribers. Cheapest subscriptions start at $10/month. If you're not a subscriber, you can still read the first few sentences of each chapter and section.
  • by 3Daemon ( 577902 ) on Wednesday February 18, 2004 @01:45PM (#8317373)

    I just had to read up on C++. I'm no expert programmer, but having experience from C and Java (in addition to having learnt the basics of Object-Oriented methodology) I wanted a book that didn't try too hard to explain everything from the bottom.

    I found C++: The core language from O'Reilly incredibly useful in this respect. In its 200 pages, it might not cover every aspect of C++, but it will give you enough to go on so that you can start using the language. Being short and focused, it will give you a good understanding of the basics a lot faster than any larger book could, IMHO.

  • by Animats ( 122034 ) on Wednesday February 18, 2004 @01:56PM (#8317483) Homepage
    The above rant was copied from here. [adequacy.org]
  • by Red Leader. ( 12916 ) on Wednesday February 18, 2004 @01:59PM (#8317512) Homepage
    I'm just learning C++, basically as an advanced beginner programmer (I already know Perl pretty well). I have Stroustrup's book, as well as one called "Data Structures and Other Objects Using C++" by Michael Main & Walter Savitch. Even for a beginner, Stroustrup's presentation is FAR superior to the one in Main & Savitch. The explanation of points is clear and there is some design chit-chat that doesn't distract much at all from whatever the section its in is really discussing. It's maybe a little bit advanced for me, but I'm here to learn, right?
  • by ibeleaf ( 751468 ) on Wednesday February 18, 2004 @02:01PM (#8317528)

    If you're interested in Accelerated C++, make sure you get a newer revision -- lots of errata in earlier copies:

    See http://www.acceleratedcpp.com/details/errata.html [acceleratedcpp.com] for a listing.

    I just ordered this from Amazon.ca... hopefully their copy is newer!

  • by stonecypher ( 118140 ) <stonecypher@gm[ ].com ['ail' in gap]> on Wednesday February 18, 2004 @02:12PM (#8317628) Homepage Journal
    The Que book is littered with omissions and errors. If you want to learn C++, start with the free Bruce Eckel e-book Thinking in C++ [mindview.net], then move on to the Meyers trio, the Sutter pair, Gang of Four, Dewhurst, Alexandrescu, then Agile Software Development, in that order.

    See Accu's booklist [accu.org], EfNet #c++'s book list [rafb.net], or Yechiel Kimchi [technion.ac.il]'s list of bad books for opposing opinions.
  • by witlessbird ( 747191 ) on Wednesday February 18, 2004 @02:17PM (#8317684)
    But where afraid to ask:

    "The C++ Programming Language" by Stroustrup

    "Effective C++: 50 Specific Ways to Improve Your Programs and Design" by Meyers

    "More Effective C++: 35 New Ways to Improve Your Programs and Designs" by Meyers

    "C++ Templates: The Complete Guide" by David Vandevoorde

  • by abigor ( 540274 ) on Wednesday February 18, 2004 @03:06PM (#8318238)
    "Modern C++ Design" is an absolute mind-bender. I don't know if I'll ever use some of that stuff - I find doing singletons the old-fashioned way works for me, quite frankly - but it sure has opened my mind. That typelist stuff - whew. And just when you thought you knew everything about smart pointers...

    What I've taken away from that book is the incredible power and elegance of policy-based design. Every working C++ programmer should understand it, I think.
  • Re:learner's library (Score:2, Informative)

    by rjshields ( 719665 ) on Wednesday February 18, 2004 @03:34PM (#8318607)
    A low level langage like C++ is definitely not for them.

    D'oh!

    All the books I've read have told me that C++ is a high level language! I must be reading the wrong books!
  • by devphil ( 51341 ) on Wednesday February 18, 2004 @03:46PM (#8318734) Homepage
    The authors obviously know their stuff

    Most definitely... since they were part of the group that helped develop the language from the beginning. They work down the hall from Stroustrup, and they are brilliant, brilliant people.

    Koenig has done all kinds of work in almost every aspect of the language and the library (if you've ever wondered why your compiler isn't finding names correctly, that's because it isn't doing Koenig lookup properly), and Moo wrote one of the first "native code" C++ compilers ever, meaning that it doesn't translate to C before going to machine code.

  • by SlayerDave ( 555409 ) <elddm1@g m a i l .com> on Wednesday February 18, 2004 @04:35PM (#8319297) Homepage
    I couldn't agree less. It is not difficult at all to avoid memory leaks and segfaults, if you know what you are doing. Some simple rules like match every 'new' with a 'delete' and use 'delete []' if you used 'new []' will prevent the majority of these problems. Setting pointers to NULL before allocation with new and after deallocation with delete will allow you to check that your pointers are valid. But then you'd know all this if you had read 'Effective C++' and 'More Effective C++' by Scott Meyers, which are the two most useful programming books I've ever read. Meyers teachs that it's not hard to write good, correct C++ code if you know what you are doing.
  • by Anonymous Coward on Wednesday February 18, 2004 @05:06PM (#8319682)
    Some simple rules like match every 'new' with a 'delete' and use 'delete []' if you used 'new []' will prevent the majority of these problems.

    A better simple rule, IMO, is to avoid new and delete (and their array versions) entirely. If you use containers from the standard library and/or good smart pointers, memory allocation problems should disappear completely. If you're using new and delete, there's more to doing it correctly than just making sure every new has a delete -- exceptions are an important consideration.
  • Re:"Practical C++" (Score:3, Informative)

    by X ( 1235 ) <x@xman.org> on Wednesday February 18, 2004 @05:54PM (#8320290) Homepage Journal
    More like:
    #include <iostream>

    int main()
    {
    std::cout << "Hello World!" << std::endl;
    }
  • by bunbunbun3 ( 754196 ) on Wednesday February 18, 2004 @07:22PM (#8321132)
    new (and delete) should really be rarely used in modern C++ programming. Use smart pointers instead.

    The standard has autoptr. Boost (www.boost.org) has loads more useful variants. 99% of the time, heap memory (i.e. allocated via new) instead of stack memory (automatic variables) is only used so that you can allocate variable amounts of memory. By using smart pointers, you can have the flexibility of new as well as the safety of automatic variables (they deallocate out of scope).

    When used as class member variables, smart pointers provide clear ownership of resources, helping programme design.

    new and delete are also classically used to manage buffers. This should be done entirely with strings, vectors and deques nowadays.

    For modern c++ programmes, run of the mill memory errors are really inexcusable, just as they are in Perl (my other favourite language). I am a full time programmer and have not had a memory/buffer error in years (yes, I have written countless kLOC and, yes, my programs have all sorts of other bugs ;-] )

I tell them to turn to the study of mathematics, for it is only there that they might escape the lusts of the flesh. -- Thomas Mann, "The Magic Mountain"

Working...