GENERIC

CODING STANDARDS

@(#)codestan.htm 3.4 08/26/02

The Generic UWF Maintenance Process (GUMP) 1994, 1995, 1996 The University of West Florida. All rights reserved.

Permission is granted to reproduce and adapt this document provided credit is given to the University of West Florida. This documentation is provided "as is" and no warranty of fitness for any particular purpose is made or implied.


NOTE: We are in the process of replacing these generic guidelines with more specific, language dependent coding standards. Standards for Java and Tcl/Tk have been written. When a standard for C/C++ is completed this document should be deleted from GUMP.

- - N. Wilde, August, 2002

ABSTRACT

This document is the Coding Guideline document for the generic maintenance process architecture for the University of West Florida. This document describes the basic conventions and coding guidelines to be used for the project. The scope is coding style and not functional organization. Coders should follow these conventions to the maximum extent possible in order to ensure a uniform appearance and improve maintainability.


PREFACE

This document is composed of four checklists that should be used by the programmer, the project coordinator, quality assurance, and anyone else who reviews the code for the project. These checklists are comprised of common ideas drawn from experts in the field, and are free from emotional ties to a particular coding style. The bibliography contains two references that provide the necessary fundamental and philosophical discussion about the finer points of code formatting.

Traditionally, many code standards have been quite dogmatic in their approach to code style. We did not wish to constrain anyone's creative abilities by imposing rigid standards on what is fundamentally a creative process: writing code. However, the guidelines presented in this document should provide the necessary guidance to produce code that has a consistent format and style to support readability and maintainability. No restriction on any construct offered by the language of choice (Ada or CJ) is stated or implied. If you can justify why you need to use a goto during code review, then by all means use it.

The only exception to this rule is in the unit and file headers. By standardizing these headers, the SE's will be able to understand the purpose of a given piece of code more easily. In addition, having a common header ensures that certain important items are documented. Appendices A-C contain the header format for units and files.


TABLE OF CONTENTS

ABSTRACT
PREFACE
1.0 COMMENTING TECHNIQUE CHECKLIST
2.0 NAMING DATA CHECKLIST
3.0 LAYOUT CHECKLIST
4.0 SELF-DOCUMENTING CODE CHECKLIST
APPENDIX A, UNIT HEADER FORMAT, C CODE
APPENDIX B, UNIT HEADER FORMAT, ADA CODE
APPENDIX C, FILE HEADER FORMAT, C AND ADA CODE
REVISION HISTORY
BIBLIOGRAPHY


1.0 COMMENTING TECHNIQUE CHECKLIST

1.1 GENERAL

1.2 STATEMENTS AND PARAGRAPHS

1.3 DATA DECLARATIONS

1.4 CONTROL STRUCTURES

1.5 ROUTINES


2.0 NAMING CONVENTION CHECKLIST

2.1 GENERAL NAMING CONSIDERATIONS

2.2 NAMING SPECIFIC KINDS OF DATA

2.3 NAMING CONVENTIONS

2.4 SHORT NAMES

2.5 COMMON NAMING PROBLEMS: HAVE YOU AVOIDED...


3.0 LAYOUT CHECKLIST

3.1 GENERAL

3.2 CONTROL STRUCTURES

3.3 INDIVIDUAL STATEMENTS

3.4 COMMENTS

3.5 ROUTINES

3.6 FILES, MODULES, AND PROGRAMS


4.0 SELF-DOCUMENTING CODE CHECKLIST

4.1 ROUTINES

4.2 DATA ORGANIZATION

4.3 CONTROL

4.4 DESIGN