Slashdot Mirror


Practical C++

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.

22 of 307 comments (clear)

  1. out of stock? by fjordboy · · Score: 4, Informative

    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 for 20.90 new or 9.00 used. Just fyi...

  2. Book spoiler by jmv · · Score: 5, Funny

    It ends with }

    1. Re:Book spoiler by david.given · · Score: 4, Funny
      It ends with }

      No, no, this is C++, remember? It ends with };.

  3. I concur by gregarican · · Score: 4, Informative
    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!

  4. Re:"Practical C++" by Anonymous Coward · · Score: 5, Funny

    And your mother too

    My mother is in fact a software developer and has no problems getting a "Hello World" to compile.

  5. old!=obsolete by RLiegh · · Score: 5, Insightful

    If you're talking about the specifics of a language to the point where the book you're reading is going to be obsolete after the next standards commitee meets--maybe you're reading the wrong book?

    However, if the book you're reading concentrates on the principlas, instead of the individual bits and pieces, age shouldn't matter.

    They still use the ritchie book after all, right?

  6. Best learner's C++? by FortKnox · · Score: 5, Informative

    (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 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 ;-)

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  7. On the subject of language by sczimme · · Score: 4, Informative


    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.)

    --
    I want to drag this out as long as possible. Bring me my protractor.
  8. The one I used by proverbialcow · · Score: 4, Informative

    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.

    --
    The only surefire protection against Microsoft infections is abstinence. - The Onion
  9. philosophical puzzlement by jejones · · Score: 4, Funny

    Overall, this is a solid book for an existing programmer to pick up C++ concepts.

    I'm not sure what books would be good for non-existing programmers.

    1. Re:philosophical puzzlement by EricTheGreen · · Score: 4, Funny

      Why, it's companion book, of course:

      Abstract C++ Programming

  10. C++ had its day by mugnyte · · Score: 4, Insightful


    For many, this C derivative is still a daily living. Thats fine. It's powerful enough.

    These days, most people approach C++ as a way to "write fast code" or they desired to get to a lower level of the machine. Or, they know C and want to learn all about OO programming. NO harm there either, although I question all these motives.

    For the most part though, end-user applications have no need to run in C++. I know the typical exceptions are in gaming, image processing and system internals, but this is a small subset of commercial programming.

    I think elementary programming skills can be taught in C++ (i've done it), but you have to peel away so much of the language, one might as well start from C anyway, and then explain OO, and then combine the two. However, the ancestry of the syntax hangs newbies too often.

    These days, I think the same goals in being "practical" could be achieved with Java for the same (if not less) effort. Plus, one learns the concepts of Events, Interfaces and a more useful standard library.

    I've cranked out over 100K of C++ (haha, not hard to do with low-density langs) but in the end, I wish it would have been a longer-lived system. Many of our framework pieces are now part of the standard Java libraries, and we would have saved quite a bit of time.

    But I think it's time for new programmers to move on.

  11. My favourite book is... by xiox · · Score: 4, Informative

    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.

  12. Re:Cease and Desist by Patrik_AKA_RedX · · Score: 5, Funny
    $650.00 per code example
    Lets assume 350 code examples, that makes $227,500
    A hit-man cost about $30,000. hmmm....
    Sorry Darl McBride, it's not personaly, it's just economics.
  13. practical? by beforewisdom · · Score: 4, Funny
    Any IT book that is over 900 pages should NOT have the word "Practical" in its title. IMHO

    Steve

  14. This book has been out a few years.. by osullish · · Score: 5, Funny

    Next review, punchcards in a nutshell (It being an O'Reilly book will have a T-Rex on the cover) :-)

    --
    It's hard enough to remember my opinions, never mind the reasons for them..
  15. Book sounds bad; read Accelerated C++ by afay · · Score: 4, Interesting

    From this review, this book sounds horrible. I can't stand books that:

    1.) Don't have a clear target audience (from the review it sounds too easy and too little details for a programmer and yet too hard for a complete beginner)

    2.) Seem like the author was paid by the page. Really, even for a complete novice, a well written book can teach C++ in less than 300 pages.

    Conclusion: Don't buy this book.

    That said, I really like Accelerated C++ for a novice programmer. The authors obviously know their stuff and it's very clear and concise. Lot's of good (not pointless little toy programs) examples that are clearly explained. Also, an example is built throughout a chapter so you don't have to comprehend everything at once. Finally, and this is the best part, STL is used from the beginning. Why save the best part of C++ for the end?

    Amazon link: Accelerated C++

    --
    Best slashdot comment
  16. Enough with C++/C/Java books! We need wider topics by Anonymous Coward · · Score: 5, Insightful

    Isn't it time we start seeing reviews of books other than C/C++/Java/Perl/C#/HTML?

    I am a hard core C++ person myself, but even I am fed up with the series of similar books on these PLs.

    There are many other topics in programming that deserve better attention by the /. developer community. Examples from the top of my head:

    Books on

    - Code optimization techniques (both for C/C++ & assembly level and optimization for web programming and DB programming)

    - Algorithms and data structures - this one will never go away whatever high level garbage collecting foolproof language/framework you end up using.

    - Software design topics (design patterns and its relatives, UML, alternative paradigms such as extreme programming)

    - Software project management topics ...

    Come on people!

  17. Re:Cease and Desist by SW6 · · Score: 5, Funny
    Lets assume 350 code examples, that makes $227,500
    A hit-man cost about $30,000. hmmm....
    Sorry Darl McBride, it's not personaly, it's just economics.

    I clearly need to move to a nicer area. The going rate for a hit round here is less than a tenth of that. And the body would probably dissolve in the river...

  18. You can't be serious. by stonecypher · · Score: 4, Informative

    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++, 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, EfNet #c++'s book list, or Yechiel Kimchi's list of bad books for opposing opinions.

    --
    StoneCypher is Full of BS
  19. Re:C++ had its day...and it is today by dmeranda · · Score: 5, Insightful

    I find that those who write off C++ really don't know the language, or at least the "modern" standardized language. C++ is incredibly powerful, and if you use solid OO techniques you really shouldn't have many issues with memory management. At least in C++ (as apposed to Java) the language guarantees that all destructors will be called and with well defined ordering. That allows you to use resource allocation patterns that greatly simplify memory manangement or resource issues entirely.

    Although you can compare pure Java with C++ as languages, it is meaningless to compare a Java framework/JDK such as J2EE with C++, as the former is an entire environment, not just the underlying language. There's lots of stuff that C++ does better than Java (generics/templates, destructors, high-performance containers, abstract algorithms). Not to mention that C++ is a completely standardized and *free* language, whereas Java is a fast moving pseudo non-free standard.

    Oh, and the syntax problems you complain about are not really all that different from Java, or even C#. Yes, they are each somewhat different and some have cleaner syntaxes for specific issues, but in the grand scheme of computer languages they are almost the same. And there are syntax problems with Java too which C++ doesn't suffer...they are both strongly based upon a C foundation, like C#, Javascript, etc.

    And yes, I've written very large C++ projects with many developers very successfully, and C++ has proven to be a very nice language indeed as long as you take the initial time to learn it correctly rather than out of a C++ for Dummy's tutorial.

    Now if you want to talk high-level languages (both Java and C++ are low-level of approximately the same power), then you should be talking about something like Python, or more academically Haskell. But Java is by no means a high level language, just as C++ is not.

  20. Re:Enough with C++/C/Java books! We need wider top by yamla · · Score: 4, Insightful

    Stop complaining and write a review yourself.

    --

    Oceania has always been at war with Eastasia.