[Next] [Prev] [Up] [Top]

4.0 Source Code Files

Documentation


4.5.1 Arrange class methods in .h files by function (GL)

The header for a class should have the methods arranged in logical groupings according to the functionality.

4.5.2 Arrange class methods in implementation files alphabetically. (GL)

Groupings of code include public functions, private functions, and class methods. Each piece of code in these groups requires commenting. Generally within a group, all logic should be arranges alphabetically. This makes it easier for other people to find.

The exception is that for class methods, the constructors should come first, followed by the destructor, then the alphabetical listing. See the code example in Appendix B.

4.5.3 Aesthetically expand method/function name titles in implementation files. (R)

The example below will make this clear. Note that there are macros for vi and emacs (M-x expand-header) to perform this formatting automatically.

// f i n d M o s t I n t e r e s t i n g

//

// This routine searches the current list of "things"

// and finds the most interesting one. If none are interesting

// or the list is empty, return NULL.

//

Thing* TThingMgr :: findMostIntersting ();


No Title
[Next] [Prev] [Up] [Top]

Generated with CERN WebMaker

This site was grabbed using the TRIAL version of Grab-a-Site. This message does not appear on a licensed copy of Grab-a-Site.