[Ada Information Clearinghouse]

Ada '83 Quality and Style:

Guidelines for Professional Programmers

Copyright 1989, 1991,1992 Software Productivity Consortium, Inc., Herndon, Virginia.

CHAPTER 10: Complete Examples

This chapter contains example programs illustrating the use of guidelines. Since many of the guidelines leave the program writer to decide what is best, there is no single best or correct example of how to use Ada. Instead, you will find several styles that differ from your own that may deserve consideration.

There are some guidelines that rarely have exceptions and leave little room for choice. When you find that these examples do not reflect the way you normally code, investigate why by finding the guideline that was followed and study the rationale. This practical exercise should be helpful in identifying potential areas of improvement (whether for you or this style guide!).

The Menu-Driven User Interface example provides a short example demonstrating many of the guidelines. It also provides the basic types for later examples.

The two versions of the Dining Philosophers example program demonstrate the portability of Ada packages and tasking. They were provided by Dr. Michael B. Feldman. Most of the available compilers can successfully compile these examples. They have also been successfully tested on a variety of platforms.

In this chapter...

10.1 Menu-Driven User Interface

10.2 Line-Oriented Portable Dining Philosophers Example

10.3 Window-Oriented Portable Dining Philosophers Example

Back to document index