Ada Style Guide

Ada Quality and Style Guide Guidelines for Professional Programmers

Contents

 * Chapter 1: Introduction
 * Chapter 2: Source Code Presentation
 * Chapter 3: Readability
 * Chapter 4: Program Structure
 * Chapter 5: Programming Practices
 * Chapter 6: Concurrency
 * Chapter 7: Portability
 * Chapter 8: Reusability
 * Chapter 9: Object-Oriented Features
 * Chapter 10: Improving Performance
 * Chapter 11: Portable Dining Philosophers Example
 * References
 * Bibliography

Preface
This style guide is an update to the Ada 95 Quality and Style Guide to reflect the latest update to the Ada language, commonly called Ada 2012. The purpose of this guide is to help computer professionals produce better Ada programs by identifying a set of stylistic guidelines that will directly impact the quality of their Ada programs. This style guide is not intended to replace the Ada Reference Manual, or the Rationale, or to serve as a tutorial for the Ada programming language.

The style guide is divided into chapters that map to the major decisions that each programmer addresses when creating high-quality, reliable, reusable, and portable Ada software. Some overlap exists in the chapters because not all programming decisions can be made independently. Individual chapters address source code presentation, readability, program structure, programming practice, concurrency, portability, reusability, performance, and a new chapter on object-oriented features.

Each chapter is divided into guidelines, using a format that supports wide usage because its content is both prescriptive and tailorable. Each guideline consists of a concise statement of the principles that should be followed and a rationale explaining why the guideline is important. The guidelines also provide usage examples, in addition to possible exceptions to applying the guidelines. Many of the guidelines are specific enough to be adopted as corporate or project programming standards. Others require a managerial decision on a particular instantiation before they can be used as standards. In such cases, a sample instantiation is presented and used throughout the examples.

Background
The Ada Joint Program Office (AJPO) funded the Ada 95 style guide, which was created by merging a set of guidelines for using Ada 95 with modifications to the original Ada Quality and Style: Guidelines for Professional Programmers, version 02.01.01 (AQ&S 83) (Software Productivity Consortium 1992), developed to support Ada 83. The Ada 95 guidelines are based on the wealth of data available from the Ada 9X Project, the AJPO library, and the Ada community at large. The Software Productivity Consortium's (Consortium's) technical staff authored the update and the Advanced Research Projects Agency (ARPA) participated in the update effort.

The preexisting AQ&S 83 presented a set of guidelines to help the programmer make disciplined use of Ada's features. In 1992, the Consortium completed the version 2.1 update to the style guide under contract to the AJPO. The AJPO referred to that style guide as "the suggested style guide for all DoD programs."

As yet, there is no formal update of the style guide for the Ada 2005 or the Ada 2012 language revision. During an extended discussion at the SIGAda 2008 conference of the style guide via-a-vis the Ada 2005 update and its continuing relevance, several attendees volunteered to bring the guide to wikibooks to encourage collaborative updating of the guide by putting the update in the hands of practitioners of the language. This is in part made possible under the terms of the DoD Ada Joint Program Office's royalty-free, worldwide, non-exclusive, irrevocable license for unlimited use of the material in the Ada 83 and 95 style guides.