Quote:
> A question about your tastes in programming style: When defining enum data,
> do you prefer to write the enum elements in UPPER or lower case?
> I.e.:
> enum Fred {ONE, TWO, THREE};
> or
> enum Fred {one, two, three};
I try to reserve all caps for identifiers that
are tinkered with by the preprocessor.
For enum members with scope outside of a single
file (defined in a .h file), I prefix the whole
set belonging to one enumeration by a few caps
that help avoid collisions with members from
other enumerations. For example:
enum CommLineErrorLevel { // (CLEL_)
CLEL_NoError = 0,
CLEL_NoiseError,
CLEL_NoResponse,
CLEL_CountOf
Quote:
};
This makes it easy to grep for the other members
when you see one somewhere.
Completely lower case identifiers are reserved
for well-localized objects, such as formal
parameters and auto variables.
--
-Larry Brasfield
(address munged, s/sn/h/ to reply)