Slashdot Mirror


Mike and Phani's Essential C++ Techniques

Reader yamla writes with the following review of Mike and Phani's Essential C++ Techniques from APress. Yamla finds a few bright spots in this book, but also several weaknesses. Read on to see whether you fit into the group he says would find this book useful. Mike and Phani's Essential C++ Techniques author Michael Hyman and Phani Vaddadi pages 239 publisher APress rating 2/10 reviewer Chris Thompson ISBN 1893115046 summary This book is useless to any other than the beginning Visual C++ 6.0 students.

The major problem This book has one killer problem: It is not aimed at C++ programmers. Let me be more specific here; it is not aimed at ANSI C++ programmers. Instead, it is aimed at Microsoft Visual C++ 6.0 programmers.

Is this a big deal? Yes. The cover of the book is rife with mentions of C++. It even mentions ANSI C++. There is one, and only one, reference to Visual C++ on the cover of the book. Even inside, the index lists only three references to Visual Studio, none to Visual C++. With quotes such as 'Hundreds of tips and techniques for advanced C++ programmers' on the cover, I was very surprised to realise this book is for Visual C++ 6.0 users only. At best, the cover of this book is misleading.

The rest of this review (and the book's rating) assumes you are still interested in the book. You therefore use only Visual C++ 6.0 and have no plans to upgrade.

Other problems

For a book apparently aimed at intermediate and advanced programmers, this book contains a lot of tips that any experienced beginner should already know. Techniques such as ensuring you never return a pointer to an automatic variable really have no place in a book with the stated audience. Really, this book would be more suited to programmers who were still learning C++.

Except there are a number of other issues that make this book poorly suited to people learning C++. Instead of using standard C++ strings, this book chooses NULL-terminated C strings. Files are not included the C++ way (cstdio instead of stdio.h, iostream instead of iostream.h). The STL is not mentioned at all, with dynamic arrays having their own chapter rather than a simple mention of vectors and with an entire chapter devoted to code for sorting instead of showing the programmer how to use the STL sorting algorithms. The smart pointers? Either use the built-in autoptr or use boost.org's vastly superior implementation.

Some good stuff

This book is not completely without redeeming qualities. Many of these techniques are good and useful. If you are a new Visual C++ 6.0 programmer and you are learning from a substandard text, you may find this book covers some of the shortfalls of your other textbook. Similarly, if you are taking a class in C++ and your instructor is particularly lousy, this book could help you out.

Summary

Mike and Phani's Essential C++ Techniques is useless to any other than the beginning Visual C++ 6.0 student. It ignores ANSI C++ to focus instead on Microsoft's implementation. It contains a number of stylistic problems, relying far too heavily on C instead of the facilities provided by C++. And finally, it only covers techniques any reasonably experienced C++ programmer should already know.

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

8 of 195 comments (clear)

  1. More specifics on VC focus by binaryDigit · · Score: 4, Insightful

    It would have been nice to have more details on how the book was soooo heavily bent towards VC++. I would assume by the fact that he makes such a big deal out of it that these references are such that it wouldn't do any good for a non VC++ programmer? Are these things specific to the environment (visual studio, debugging, etc) or the OS (win32 api, m$ specific data types, etc).

    Overall, I think his review needs a bit more beef (i.e. more examples) vs just saying "I thought it was blah ..." and us having to just take his word for it. Even more so because of the topic and the level at which it is apparently targeted.

    1. Re:More specifics on VC focus by yamla · · Score: 4, Informative

      I initially included examples of how it was bent so completely toward VC++ but it really made the review hard to read.

      It is comments such as 'Always use at least warning level 3', with information on how to select it in Visual C++ but without any note that this isn't an ansi-C++ technique, that really annoyed me. The book is littered with techniques that would only work in Visual C++ (and only with Visual C++ 6.0). There are sixteen chapters and I was able to find several examples in pretty much every single chapter. This was all the worse because the book appears to be targetted at ansi-C++.

      --

      Oceania has always been at war with Eastasia.
  2. Kickasso reviews 99.99% of all C++ books at once! by Kickasso · · Score: 4, Informative
    They are crap.

    In the beginners department you can't beat Accelerated C++ by Koenig and Moo. For more advanced programmers there is Scott Meyers.

  3. Re:Difference between MS and ANSI? by Viking+Coder · · Score: 5, Informative
    Microsoft is not particularly ANSI C++ compliant. And it's STL implementation is fairly lousy. That makes it hard to both port code TO and FROM MSVC++, because you expect certain standardized behavior, and Microsoft's implementation of C++ is not correct in all cases. (Note that, until fairly recently, NO C++ implementation was ever "correct" according to the standards.)

    It basically means that there are perfectly legal constructs in ANSI C++ that are not allowed in MS Visual C++.

    The best example I can name off the top of my head is that something like this is not allowed in MSVC++:
    template <class Type>
    Type myFunction()
    {
    Type result;
    // do calculations at the precision of Type
    return result;
    }

    int r = myFunction<int>();
    // supposed to be allowed in ANSI C++,
    // but it isn't in MSVC++. They just can't
    // parse it, for whatever reason.
    And there are things that MS Visual C++ allows by default that it's not supposed to. The most glaring example I can come up with off the top of my head is:
    // do something in a loop with variable i
    for (int i = 0; i < 10; ++i)
    {
    }
    int other = i;
    // re-use the variable i - NOT ALLOWED
    // i is supposed to lose scope after
    // the above for-loop
    As an aside, the Intel compiler is far better.
    --
    Education is the silver bullet.
  4. Re:Difference between MS and ANSI? by alefbet · · Score: 5, Informative
    Microsoft Visual C++ has a few extensions to the language, mostly inherited from its extension to the C language, and nothing you can't get by without (unless you are looking at its "WinMain" function or other extensions designed specifically for programming under windows).

    On the other hand, there are some problems with the language and libraries if you try to compile code ported from another compliant compiler.
    • for loops do not create a new scope (resulting in error messages if you reuse/redeclare for loop counters). I believe this is fixable with compiler flags in Visual Studio.NET. (Technically it's fixable with compiler flags in Visual C++ 6, but the header files won't compile if you try it.)
    • Visual C++ does not support Koenig lookup (good riddance IMHO, except the standard has it so I think Visual C++ should at least have a compiler option to use it). It is implemented for operator overloads, but not general functions.
    • Visual C++ doesn't support partial template specialization (which I've really missed from time to time when writing reusable templates).
    • Visual C++ can't parse the syntax for declaring a template member function and defining it outside the class body (not to be confused with a member function of a template). All such template member functions must be defined inline, causing some clutter in the class definition.
    • The auto_ptr implementation is missing a critical member function (causing me to use it with STLport to get proper functionality of pieces of the standard library). You may be able to solve this problem by purchasing the latest version of the Dinkumware libraries to use with Visual C++. (Dinkumware provided the version of the libraries that ship with VC6.)
    I've probably missed stuff. This is just what I've generally run into.
    --

    A hack is just an idiom waiting for wider use.
  5. Re:Difference between MS and ANSI? by yamla · · Score: 4, Interesting

    I did try to point out that the book was bad even for Visual C++ programmers. It uses old-style C++ (#include , for example), ignores valuable contributions to C++ such as the STL and the standard string class, and generally provides nothing a decent C++ programmer should not already know.

    It isn't so much that the examples are targetted for Visual C++ 6.0, it is that the techniques themselves are. It is no good telling me, 'If you set eax from assembly, disable warning 4035' unless I am using Visual C++ on an ix86-compatible processor. It just doesn't translate to any other platform.

    --

    Oceania has always been at war with Eastasia.
  6. For MSVC development by Timesprout · · Score: 4, Interesting

    If MSVC is your only environment try here for tips and pointers. They cover a lot of other stuff as well. For pure C++ then as others have said go with Myers / Stroustrup etc

    --
    Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
    What truth?
    There is no dupe
  7. Book is from 1999 by 1st1 · · Score: 5, Informative

    It is an old book: September 1999

    --
    NullPointerException