skip to main content
Skip header Section
C+ C++: programming with objects in C and C++August 1992
Publisher:
  • McGraw-Hill, Inc.
  • Professional Book Group 11 West 19th Street New York, NY
  • United States
ISBN:978-0-07-029662-6
Published:01 August 1992
Pages:
427
Skip Bibliometrics Section
Bibliometrics
Contributors

Recommendations

Cay Stephan Horstmann

Holub takes an unusual approach to introducing object-oriented programming. The first chapter of this book shows how three fundamental techniques—methods, inheritance, and virtual functions—can be implemented in plain C. Then the book follows the more traditional approach of C++ texts. The subsequent chapters cover C++ as a better C, classes, operator overloading, derivation, polymorphism, and an example class library. Familiarity with ANSI C is assumed. The book is unusual in another respect: the author admits to bringing a “curmudgeon's perspective” to the task of introducing C++. He succeeds admirably, roundly criticizing the bad (and occasionally the good) features of the language. The deviation from the standard object orientation cheerleading is refreshing. The advantage of introducing C implementations of member functions and virtual functions in the first chapter is not clear. The author has to cover technical details that can be quickly forgotten by the C++ user and simultaneously convince the reader that the object-oriented techniques are worthwhile. The traditional approach, in which these techniques are introduced in a C++ setting, with a brief explanation of possible C implementations, seems preferable. After the strongly object-oriented view in chapter 1, the next chapter, covering small differences between C and C++, seems anticlimactic. In later chapters, the author covers advanced issues such as multiple inheritance, templates, and class libraries with a good deal more competence and depth than typical C++ textbooks such as Pohl [1]. The author has strong opinions about coding style. Much of his advice is useful, such as the recommendation to use explicit casts rather than letting the compiler perform implicit type conversion to match an overloaded function. A few remarks, such as the condemnation of default function arguments, seem less reasonable. Someone who is already familiar with C++ may want to turn to Meyers [2] for guidance. As is common with trade books, little technical reviewing seems to have taken place, and the book contains many inaccuracies. For example, the scope of a variable declared in the header of a <__?__Pub Fmt italic>for<__?__Pub Fmt /italic> loop is misstated. The author claims that in C++, the default return type of a function is <__?__Pub Fmt italic>void<__?__Pub Fmt /italic>. Sadly, it is still <__?__Pub Fmt italic>int<__?__Pub Fmt /italic>, just as in C. Holub claims that distinct overloaded functions <__?__Pub Fmt italic>f<__?__Pub Fmt /italic><__?__Pub Fmt kern Amount="1pt">(<__?__Pub Fmt italic>int<__?__Pub Fmt /italic>) and <__?__Pub Fmt italic>f<__?__Pub Fmt /italic><__?__Pub Fmt kern Amount="1pt">(<__?__Pub Fmt italic>const int<__?__Pub Fmt /italic>) can be defined; of course, they cannot. The <__?__Pub Fmt italic>const<__?__Pub Fmt /italic> attribute can only be used to differentiate arguments that are passed by reference. The lack of exercises makes this book unsuitable as a classroom text. The bibliography is skimpy. With a wide selection of C++ books to choose from, why should anyone consider buying this book__?__ As a general reference, the book by Bjarne Stroustrup, the designer of C++<__?__Pub Fmt hardspace>[<__?__Pub Caret1>3], is highly recommended, but it is difficult for beginners. Holub's book can be recommended to those who seek a more basic introduction to object-oriented programming and who appreciate seeing the new material presented in familiar C terms. Unlike competing books, this volume covers advanced issues thoroughly. The author does not merely present features, he analyzes and evaluates their usefulness. The book will be particularly appreciated by those who are taken aback by the religious fervor of recent converts to object orientation.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.