Next: Class Member Declaration List
Up: Software Development and Coding
Previous: Provide easy access to
  Contents
Enumerations is the long lost rich uncle that every programmer forgets
about. They are a goldmine of simplification.
Enumeration guidelines:
- Use enumerations instead of #define.
- Encapsulate the enumeration inside a class if you can. This way
it can be identified as being closely related to that particular
class. This will also prevent a rogue enumeration from appearing in
a header file all by itself so that you and Waldo have to search
many files to find out where it is used.
- typedef your enumerations to make them more usable.
- Prefix enumeration variable names with enum. This way, when the
variable is used you know exactly what it is.
19#19
Use enumerations for bit masks:
20#20
Even for keeping track of a class version:
21#21
See the Tips and Tricks section for more information on class versioning.
Falko Kuester
2001-08-24