Excerpt
C++ Distilled: A Concise ANSI/ISO Reference and Style Guide is a companion volume for the student or professional programmer who uses ANSI C++, including the I/O, and STL library. It supplements and brings up-to-date existing literature.
This book is a concise road map and style guide to C++. It selectively previews the proposed ANSI standard C++ language and includes many programming tips. It is easily used with any C++ programming book (see Chapter 20, "References," on page 189, for a selection), but is especially suitable when used with one of the author's books, such as Object-Oriented Programming Using C++, 2nd Edition (reference OPUS 97).
Each section has the syntax, semantics, and examples of the language element. There are style and programming tips at the end of most sections. Examples have a consistent professional style to be mimicked by programmers.
This book is a distillation of the ANSI standard, which is approximately 700 detailed technically dense pages, and rather overwhelming. Fortunately most programmers do not need such detail; indeed, many of the features are highly specialized and little used. Most programmers need to be able to quickly review some syntax or semantics they have not recently used.
C++ has had many recent additions, including STL, namespaces, RTTI, and the bool
type. These can be used readily by someone already proficient in basic C++, but most books have yet to treat these topics. This book can provide a handy guide to these new constructs.
The examples both within the book are intended to exhibit good programming style. Most programming is done in my imitation of existing code and idioms. These examples use my prescriptions and programming tips ("Dr. P's Prescriptions") which are a distillation of considerable professional practice.
The Addison-Wesley web site contains the programs in this book as well as adjunct programs that illustrate the points made in the book or flesh out short pieces of programs. The programs available at the web site are introduced by their .cpp or .h names.
Example Program
In file hello1.cpp
//Traditional first program #include int main() { cout < "hello="" world!"="">< endl;=""> } Dr. P's Prescriptions: Style and Rule Tips
- Use the style found in this book.
- Be consistent with whatever style you choose.
Prescription Discussion
Style emphasizes clarity and community norms. Consistency, while the hobgoblin of small minds, is well suited to large computer codes.
Acknowledgments
This book was developed with the support of my editor J. Carter Shanklin, editorial assistant Angela Buenning, and production coordinator Pamela Yee. Thanks also to reviewers Ed Lansinger of General Motors Corporation; Henry A. Etlinger of Rochester Institute of Technology; Glen Deen of Deen Publications, Inc.; Michael Keenan of Columbus State University; and David Gregory. Most importantly, I thank Debra Dolsberry for her invaluable help in the technical editing of this book, and her careful testing of the code.
0201695871P04062001