Programming in C++
Rules and Recommendations

Copyright (C) 1990-1992 by

Ellemtel Telecommunication Systems Laboratories

Box 1505
125 25 Alvsjo
Sweden
Tel: int + 46 8 727 30 00

Permission is granted to any individual or institution to use, copy, modify, and distribute this document, provided that this complete copyright and permission notice is maintained intact in all copies.

Ellemtel Telecommunication Systems Laboratories makes no representations about the suitability of this document or the examples described herein for any purpose. It is provided "as is" without any expressed or implied warranty.

Original translation from Swedish by Joseph Supanich.

The layout of this document has been modifyed by Per Cederqvist so that it is more readable on a 80-column screen. I.e. paragraphs has been refilled.

Additional layout modifications by Gary Shea (shea@cs.ukans.edu) and Mats Henricson (mats.henricson@eua.ericsson.se).

Conversion to HTML with links by Robert M. Adams (radams@khis.com).

The appearance of indicates a comment by R. M. Adams. The symbol is a link to that comment.

Table of Contents

-----------------
  1. Introduction
  2. Terminology
  3. General Recommendations
  4. Source Code in Files
    1. Structure of Code
    2. Naming Files
    3. Comments
    4. Include Files
  5. Assigning Names
  6. Style
    1. Classes
    2. Functions
    3. Compound Statements
    4. Flow Control Statements
    5. Pointers and References
    6. Miscellaneous
  7. Classes
    1. Considerations Regarding Access Rights
    2. Inline Functions
    3. Friends
    4. const Member Functions
    5. Constructors and Destructors
    6. Assignment Operators
    7. Operator Overloading
    8. Member Function Return Types
    9. Inheritance
  8. Class Templates
  9. Functions
    1. Function Arguments
    2. Function Overloading
    3. Formal Arguments
    4. Return Types and Values
    5. Inline Functions
    6. Temporary Objects
    7. General
  10. Constants
  11. Variables
  12. Pointers and References
  13. Type Conversions
  14. Flow Control Structures
  15. Expressions
  16. Memory Allocation
  17. Fault Handling
  18. Portable Code
    1. Data Abstraction
    2. Sizes of Types
    3. Type Conversions
    4. Data Representation
    5. Underflow/Overflow
    6. Order of Execution
    7. Temporary Objects
    8. Pointer Arithmetic
  19. References
  20. Summary of Rules
  21. Summary of Recommendations
  22. Summary of Portability Recommendations
  23. Appendix Form for Rule Change Request (not included in this hypertext)

Robert M. Adams' Home Page