Cover image for The elements of C++ style
The elements of C++ style
Misfeldt, Trevor, 1969-
Personal Author:
Publication Information:
Cambridge, [England] ; New York : Cambridge University, [2004]

Physical Description:
viii, 182 pages ; 18 cm
Format :


Call Number
Material Type
Home Location
Item Holds
QA76.73.C153 E28 2004 Adult Mass Market Paperback Central Closed Stacks

On Order



The Elements of C++ Style is for all C++ practitioners, especially for those working in teams where consistency is critical. Just as Strunk and White's The Elements of Style provides rules of usage for writing in the English language, this text furnishes a set of rules for writing in C++. The authors offer a collection of standards and guidelines for creating solid C++ code that will be easy to understand, enhance and maintain. The book provides conventions for formatting, naming, documentation, programming, and packaging for the latest ANSI standard of C++, and also includes discussion of advanced topics such as templates. Trevor Misfeldt is co-author of Elements of Java Style (Cambridge, 2000) and CEO of CenterSpace Software. Gregory Bumgardner is a Freelance Consultant with twenty-five years of experience in software design and implementation. He is co-author of Elements of Java Style (Cambridge, 2000). Andrew Gray is Director of Engineering for Intellichem, Inc. He was previously Software Engineering Manager and Technology Evangelist at Rogue Wave Software, where he led the development of XML infrastructure solutions.

Author Notes

Trevor Misfeldt: CenterSpace Software
Gregory Bumgardner: Freelance Consultant
Andrew Gray: IntelliChem Inc.

Reviews 1

Choice Review

Misfeldt, Burngardner, and Gray have prepared a small book patterned after the very successful Elements of Style, by Strunk and White, a book for students of English composition. The Elements of C++ Style does not teach one the C++ language but rather presents 175 "rules" of good usage for C++ programmers spread over 150 small (4.5 by 7.0-inch) pages. Eight chapters categorize the rules into logical groups, from introductory rules to more sophisticated conventions for formatting, naming, and documenting C++ programming code. Although some readers may not agree with all the rules, this book is a very good start, especially for programmers who will work as part of a team where uniformity of coding is desired. The book does not offer anything revolutionary, but it is a very good source for consistent coding style that might be presented in a more fragmented manner in introductory C++ programming books. The book would be a nice addition to the library of a serious programmer and should be made available to a team leader of a C++ software design group. ^BSumming Up: Highly recommended. Upper-division undergraduate and graduate students; professionals. R. J. Shine Ramapo College of New Jersey

Table of Contents

Prefacep. vii
Audiencep. vii
1. Introductionp. 1
Disclaimerp. 2
Acknowledgmentsp. 2
2. General Principlesp. 4
3. Formatting Conventionsp. 7
3.1 Indentationp. 7
4. Naming Conventionsp. 17
4.1 Preprocessor Macro Namesp. 17
4.2 Type and Constant Namesp. 18
4.3 Function Namesp. 19
4.4 Variable and Parameter Namesp. 21
4.5 Generalp. 25
5. Documentation Conventionsp. 29
6. Programming Principlesp. 41
6.1 Engineeringp. 41
6.2 Class Designp. 45
6.3 Thread Safety and Concurrencyp. 53
7. Programming Conventionsp. 58
7.1 Preprocessorp. 58
7.2 Declarationsp. 63
7.3 Scopingp. 67
7.4 Functions and Methodsp. 68
7.5 Classesp. 74
7.6 Class Membersp. 78
7.7 Operatorsp. 93
7.8 Templatesp. 100
7.9 Type Safety, Casting, and Conversionp. 102
7.10 Initialization and Constructionp. 112
7.11 Statements and Expressionsp. 119
7.12 Control Flowp. 124
7.13 Error and Exception Handlingp. 129
7.14 Efficiencyp. 137
8. Packaging Conventionsp. 141
8.1 Scopingp. 141
8.2 Organizationp. 143
8.3 Filesp. 147
Summaryp. 151
Glossaryp. 161
Bibliographyp. 171
Indexp. 173