C++ Programming Style

Front Cover
Addison-Wesley Publishing Company, 1992 - Computers - 233 pages
1 Review

C++ supports programming-in-the-large, allowing relationships between different parts of a program to be expressed. The scope of C++ programming style therefore goes beyond traditional in-the-small issues which relate to the details of line-by-line coding. This book examines the use of the in-the-large language features of C++, which sometimes confuse even experienced programmers. The author demonstrates that unwarranted use of the more powerful language features may lead to cluttered programs which are harder to comprehend and sometimes less efficient than more straightforward alternatives. Cargill rewrites several programs, using techniques that range from improving consistency to removing redundant inheritance. The presentation simulates a code review, in which readers may independently evaluate and criticize alternative approaches to programming problems, and then compare their analyses with those of the author.

Design and coding style rules are distilled from the examples. Understanding and following these rules will help professional programmers design and write better C++ programs.

A chapter is devoted to each of the following topics:

  • abstractions
  • operator overloading
  • consistency
  • wrappers
  • unnecessary inheritance
  • efficiency
  • virtual functions
Building on the programming rules introduced in the first seven chapters, Cargill presents a case study in which a single program undergoes repeated transformations that improve its overall quality while reducing its size. The book concludes with a chapter on multiple inheritance.


0201563657B04062001

From inside the book

What people are saying - Write a review

User Review - Flag as inappropriate

A great intro and guideline for C++ style. Most of the chapters open with code that solves a particular problem, then goes on to evolve a much better solution, pointing out nice C++ idioms and alternatives along the way. In the spirit of Kernighan and Plauger's, "The Elements of Programming". 

Contents

Abstraction
7
Consistency
29
Unnecessary Inheritance
49
Copyright

7 other sections not shown

Common terms and phrases

References to this book

All Book Search results »

About the author (1992)

Tom Cargill is a well-regarded expert in C++. While at AT&T Bell Laboratories, Murray Hill, NJ, he was among the first programmers to use C++. He is a columnist for The C++ Journal and The C++ Report, and is also the author of two of Technology Exchange Company's C++ courses. The material for this book was originally developed for tutorials that Cargill has presented at numerous technical conference.



0201563657AB04062001

Bibliographic information