Laying Out Classes
This section presents guidelines for laying out code in classes. The first subsection describes how to lay out the class interface. The second subsection describes how to lay out the class implementations. The final subsection discusses laying out files and programs.
Laying Out Class Interfaces
In laying out class interfaces, the convention is to present the class members in the following order:
Cross-Reference
For details on documenting classes, see "Commenting Classes, Files, and Programs" in Commenting Techniques. For a discussion of the differences between good and bad classes, see Chapter 6.
Header comment that describes the class and provides any notes about the overall usage of the class
Constructors and destructors
Public routines ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access