Mail Archives: djgpp/2003/07/24/08:05:04
Joel wrote:
>
> Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote in message news:<bfm1d7$db6$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>...
> > Joel <jbs30000 AT aol DOT com> wrote:
> > > From here
> > > http://www.delorie.com/djgpp/doc/ug/graphics/vbe20.html
> > > I used code to get protected mode function offsets. And instead of
> > > using vesa_pm_info I just called it VESA_PM.
> >
> > Please re-think that decision. By ancient tradition in both C and
> > C++, NAMES_IN_ALL_CAPS are reserved for #define'd macros and possibly
> > enum labels. You'll mislead anyone else who may get to read your code
> > later.
> >
> Didn't realize about the all caps rule, thanks for the info.
It isn't really a "rule," but more of an "accepted practice,
subject to sensible exceptions." For example, C's <stdio.h> header
provides a definition for something called a `FILE' that is quite
often a struct, not a macro; <assert.h> defines `assert' which is
*required* to be a macro despite the lower-case name; and so on.
Still, if you follow this convention "most of the time" your
code will be somewhat easier for a human reader to understand.
--
Eric Sosman
esosman AT acm DOT org
- Raw text -