Layout ------------------------------------------------------------------------ General * Is formatting done primarily to illuminate the logical structure of the code? * Can the formatting scheme be used consistently? * Does the formatting scheme result in code that's easy to maintain? * Does the formatting scheme improve code readability? Control Structures * Does the code avoid doubly indenting begin/end pairs? * Are sequential blocks separated with blank lines? * Are complicated boolean expressions formatted for readability? * Are single-statement blocks formatted consistently? * Are case statements formatted in a way that's consistent with the formatting of other control structures? * Have gotos been formatted in a way that makes their use obvious? Individual Statements * Do incomplete statements end the line in a way that's obviously incorrect? * Are continuation lines indented sensibly? * Are groups of related statements aligned? * Are groups of unrelated statements unaligned? * Does each line contain—at most—one statement? * Is each statement written without side effects? * Are data declarations aligned? * Is there--at most--one data declaration per line? Comments * Are the comments indented the same as the code? * Is the commenting style easy to maintain? Routines * Are the arguments to each routine formatted so that each argument is easy to read, modify, and comment? * In C, are new-style routine declarations used? * In Fortran, are parameters declared separately from local variables? Files, Modules, and Programs * Does each file hold code for one and only one module? * Are routines within a file clearly separated with blank lines? * If a file does contain multiple modules, are all the routines in each module grouped together and is the module clearly identified? * Alternatively, are all routines in alphabetical sequence? ------------------------------------------------------------------------ Copyright © 1996-1998 Construx Software Builders, Inc.