C++ programming style
By: Tom Cargill.
Series: Addison-Wesley professional computing series
Publisher: Addison-Wesley Pub. Co.
Published: 1992
Place of publication: Reading, Mass
Language: eng
Number of pages: 233
Subjects: C++ (Computer program language)
Other titles: C plus plus programming style.
First sentence: The presentation of material throughout the book follows a uniform method.
Description: This book examines the in-the-large language features of C++, demonstrating that unwarranted use of language features may lead to cluttered programs that are harder to comprehend and sometimes less efficient than straightforward alternatives. Cargill rewrites several programs using techniques ranging 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 programmers design and write better C++ programs.  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. (back cover copy)
Notes: Includes bibliographical references and index.
Table of contents: pagenum: ix
title: Preface; title: Introduction
pagenum: 1
label: 0; pagenum: 5
title: Bibliographic Notes; title: Abstraction
pagenum: 7
label: 1; pagenum: 7
title: Style Example: Pricing Computers; pagenum: 12
title: Finding a Common Abstraction; pagenum: 15
title: Differences between Classes; pagenum: 19
title: Reintroducing Inheritance; pagenum: 21
title: Removing the Enumerations; pagenum: 24
title: Summary; pagenum: 25
title: Bibliographic Notes; pagenum: 25
title: Exercise; title: Consistency
pagenum: 29
label: 2; pagenum: 30
title: Style Example: Class string; pagenum: 31
title: Well-defined State; pagenum: 32
title: Consistent Physical State; pagenum: 34
title: Class Invariants; pagenum: 35
title: Consistent Use of Dynamic Memory; pagenum: 37
title: Deallocating Dynamic Memory; pagenum: 38
title: Style Example: A Second Approach; pagenum: 45
title: Summary; pagenum: 45
title: Bibliographic Notes; pagenum: 46
title: Excercises; title: Unnecessary Inheritance
pagenum: 49
label: 3; pagenum: 49
title: Style Example: Stacks; pagenum: 53
title: Inheritance Scope Rules; pagenum: 59
title: Encapsulation; pagenum: 62
title: Interface versus Implementation; pagenum: 66
title: Templates; pagenum: 68
title: Summary; pagenum: 68
title: Bibliographic Notes; pagenum: 69
title: Exercise; title: Virtual Functions
pagenum: 71
label: 4; pagenum: 71
title: Style Example: Vehicles and Garages; pagenum: 75
title: Consistency; pagenum: 77
title: Base Destructors; pagenum: 79
title: Inheritance; pagenum: 82
title: Coupling; pagenum: 89
title: Summary; pagenum: 89
title: Bibliographic Notes; pagenum: 89
title: Exercise; title: Operator Overloading
pagenum: 91
label: 5; pagenum: 91
title: Operator overloading Basics; pagenum: 96
title: Style Example: Class FileArray; pagenum: 104
title: Inheritance for Implementation; pagenum: 109
title: A Programming Tradeoff: Overloaded Operators versus Member Functions; pagenum: 111
title: Summary; pagenum: 111
title: Bibliographic Notes; pagenum: 112
title: Exercises; title: Wrappers
pagenum: 113
label: 6; pagenum: 113
title: A C Library; pagenum: 114
title: Style Example: A C++ wrapper for dirent; pagenum: 116
title: Multiple Directory Objects; pagenum: 119
title: Constructor Failure; pagenum: 121
title: Public Access to Failure State; pagenum: 123
title: Error Condition Argument; pagenum: 128
title: Summary; pagenum: 128
title: Bibliographic Notes; pagenum: 128
title: Exercise; title: Efficiency
pagenum: 129
label: 7; pagenum: 130
title: Style Example: Class BigInt; pagenum: 137
title: Exercising BigInt; pagenum: 138
title: The Length of Dynamic Strings; pagenum: 140
title: The Number of Dynamic Strings; pagenum: 144
title: The Client Code; pagenum: 146
title: Rewriting BigInt; pagenum: 153
title: Summary; pagenum: 153
title: Bibliographic Notes; pagenum: 153
title: Exercises; title: A Case Study
pagenum: 155
label: 8; pagenum: 155
title: Style Example: Finite State Machines; pagenum: 161
title: Initialization; pagenum: 169
title: Coupling; pagenum: 174
title: Cohesion; pagenum: 177
title: Modules versus Abstract Data Types; pagenum: 180
title: Value versus Behavior; pagenum: 185
title: Generalization; pagenum: 190
title: Bibliographic Notes; pagenum: 190
title: Exercises; title: Multiple Inheritance
pagenum: 191
label: 9; pagenum: 191
title: Ambiguities under Multiple Inheritance; pagenum: 194
title: Directed Acyclic Inheritance Graphs; pagenum: 197
title: Exploring Virtual Base Classes; pagenum: 204
title: Style Example: Class Monitor; pagenum: 209
title: Style Example: A Virtual Base Class; pagenum: 215
title: Multiple Protocol Inheritance; pagenum: 218
title: Summary; pagenum: 219
title: Bibliographic Notes; pagenum: 219
title: Exercises; title: Summary of Rules
pagenum: 221
label: 10; pagenum: 225
title: Index