Axiom
A C++ program consists of a set of global declarations/definitions and
several nested groups of instructions. Each group of instructions is
delimited by curly brackets ({ }).
Definition
The rank of a group of instructions in a C++ program is the
nesting level of the group in the program. Global
declarations/definitions are defined to be at rank 0.
Definition
Consider a C++ program with instructions
. For a
given
, a group of
instructions
at
rank
in a C++ program is well-
-indented if:
Definition
A C++ program is well-indented if there is an integer
such
that (a) the global declarations/definitions start at column 0, and
(b) each of its instruction groups is well-
-indented.
Fact
Usual values for
are 2, 4, 8. In this course, the value
is
favoured as it allows for a greater number of nesting levels to be
displayed in 80 characters (the usual screen width on UNIX systems).
Leo Liberti 2008-01-12