O'Reilly logo

Code Complete, Second Edition by Steve McConnell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

  1. Header comment that describes the class and provides any notes about the overall usage of the class

  2. Constructors and destructors

  3. Public routines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required