An edition of C++ programming style (1992)

C++ programming style

  • 1 Want to read

My Reading Lists:

Create a new list

Check-In

×Close
Add an optional check-in date. Check-in dates are used to track yearly reading goals.
Today

  • 1 Want to read

Buy this book

Last edited by ImportBot
August 18, 2020 | History
An edition of C++ programming style (1992)

C++ programming style

  • 1 Want to read

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)

Publish Date
Language
English
Pages
233

Buy this book

Previews available in: English

Edition Availability
Cover of: C++ programming style
C++ programming style
1992, Addison-Wesley Pub. Co.
in English

Add another edition?

Book Details


First Sentence

"The presentation of material throughout the book follows a uniform method."

Table of Contents

Preface
Page ix
0. Introduction
Page 1
Bibliographic Notes
Page 5
1. Abstraction
Page 7
Style Example: Pricing Computers
Page 7
Finding a Common Abstraction
Page 12
Differences between Classes
Page 15
Reintroducing Inheritance
Page 19
Removing the Enumerations
Page 21
Summary
Page 24
Bibliographic Notes
Page 25
Exercise
Page 25
2. Consistency
Page 29
Style Example: Class string
Page 30
Well-defined State
Page 31
Consistent Physical State
Page 32
Class Invariants
Page 34
Consistent Use of Dynamic Memory
Page 35
Deallocating Dynamic Memory
Page 37
Style Example: A Second Approach
Page 38
Summary
Page 45
Bibliographic Notes
Page 45
Excercises
Page 46
3. Unnecessary Inheritance
Page 49
Style Example: Stacks
Page 49
Inheritance Scope Rules
Page 53
Encapsulation
Page 59
Interface versus Implementation
Page 62
Templates
Page 66
Summary
Page 68
Bibliographic Notes
Page 68
Exercise
Page 69
4. Virtual Functions
Page 71
Style Example: Vehicles and Garages
Page 71
Consistency
Page 75
Base Destructors
Page 77
Inheritance
Page 79
Coupling
Page 82
Summary
Page 89
Bibliographic Notes
Page 89
Exercise
Page 89
5. Operator Overloading
Page 91
Operator overloading Basics
Page 91
Style Example: Class FileArray
Page 96
Inheritance for Implementation
Page 104
A Programming Tradeoff: Overloaded Operators versus Member Functions
Page 109
Summary
Page 111
Bibliographic Notes
Page 111
Exercises
Page 112
6. Wrappers
Page 113
A C Library
Page 113
Style Example: A C++ wrapper for dirent
Page 114
Multiple Directory Objects
Page 116
Constructor Failure
Page 119
Public Access to Failure State
Page 121
Error Condition Argument
Page 123
Summary
Page 128
Bibliographic Notes
Page 128
Exercise
Page 128
7. Efficiency
Page 129
Style Example: Class BigInt
Page 130
Exercising BigInt
Page 137
The Length of Dynamic Strings
Page 138
The Number of Dynamic Strings
Page 140
The Client Code
Page 144
Rewriting BigInt
Page 146
Summary
Page 153
Bibliographic Notes
Page 153
Exercises
Page 153
8. A Case Study
Page 155
Style Example: Finite State Machines
Page 155
Initialization
Page 161
Coupling
Page 169
Cohesion
Page 174
Modules versus Abstract Data Types
Page 177
Value versus Behavior
Page 180
Generalization
Page 185
Bibliographic Notes
Page 190
Exercises
Page 190
9. Multiple Inheritance
Page 191
Ambiguities under Multiple Inheritance
Page 191
Directed Acyclic Inheritance Graphs
Page 194
Exploring Virtual Base Classes
Page 197
Style Example: Class Monitor
Page 204
Style Example: A Virtual Base Class
Page 209
Multiple Protocol Inheritance
Page 215
Summary
Page 218
Bibliographic Notes
Page 219
Exercises
Page 219
10. Summary of Rules
Page 221
Index
Page 225

Edition Notes

Includes bibliographical references and index.

Published in
Reading, Mass
Series
Addison-Wesley professional computing series
Other Titles
C plus plus programming style.

Classifications

Dewey Decimal Class
005.13/3
Library of Congress
QA76.73.C153 C37 1992

The Physical Object

Pagination
xi, 233 p. :
Number of pages
233

Edition Identifiers

Open Library
OL1712909M
Internet Archive
cprogrammingstyl0000carg
ISBN 10
0201563657
LCCN
92015026
Goodreads
1965545

Work Identifiers

Work ID
OL4287854W

Community Reviews (0)

No community reviews have been submitted for this work.

Lists

This work does not appear on any lists.

History

Download catalog record: RDF / JSON
August 18, 2020 Edited by ImportBot import existing book
July 8, 2020 Edited by ImportBot import existing book
May 18, 2012 Edited by EdwardBot update for books with wrong subjects
October 24, 2011 Edited by ImportBot import new book
December 10, 2009 Created by WorkBot add works page