Only the outline of this manual has been written -- it needs a LOT of work!!
The basic goal behind choosing names in the STAMP function library is for the name to convey information about what it represents. This is achieved in two ways: striving for a descriptive name rather than a short cryptic abbreviated name, and following a different pattern of capitalization for each type of name.
Preprocessor macro names are written entirely in capital letters. If
the name requires more than one word for an adequate description, the
words are joined together with intervening underscore (_
)
characters.
Data structure names consist of one or more capitalized words. If the name requires more than one word for an adequate description, the words are joined together without underscores, depending on the capitalization pattern to make them readable as separate words.
Variable names in the STAMP function library follow a modified form of the Hungarian naming convention described by Steve McConnell in his book Code Complete on pages 202-206.
Variable names have three parts: a lowercase type prefix, a descriptive name, and a scope suffix.
The type prefix has the following basic possibilities:
b
char
, short
, or int
c
char
but sometimes a short
or
int
d
double
e
enum
or as a char
,
short
, or int
i
int
, short
, long
, or
(rarely) char
s
struct
statement
sz
pf
In addition, the basic types may be prefixed by these qualifiers:
u
a
p
The descriptive name portion of a variable name consists of one or more
capitalized words concatenated together. There are no underscores
(_
) separating these words from each other, or from the type
prefix. For the STAMP function library, the descriptive
name for global variables
begins with Stamp
.
The scope suffix has these possibilities:
_g
_m
static
)
_in
_out
_io
_s
static
)
The lack of a scope suffix indicates that a variable is declared within a function and exists on the stack for the duration of the current call.
Global function names in the STAMP function library have
two parts: a verb that is all lowercase followed by a noun phrase
containing one or more capitalized words. These pieces are
concatanated without any intervening underscores (_
). For the
STAMP library functions, the noun phrase section
includes
Stamp
.
Given the discussion above, it is easy to discern at a glance what type of item each of the following names refers to.
SAMPLE_NAME
SampleName
pSampleName
writeSampleName
SampleName
).
Jump to:
This document was generated on 20 March 2003 using texi2html 1.56k.