solutions exist that the choice of an optimal program requires a thorough analysis not only of the available algorithms and computer systems but also of the way in which the program will most frequently be used. 

Consequently, the construction of a program should consist of a sequence of deliberations, investigations, and design decisions. In the early stages, attention is best concentrated on the global problems, and the first draft of a solution may pay little attention to details. As the design process progresses, we can split the problem into sub-problems, and gradually give more consideration to the details of problem specification and to the characteristics of the available tools. The terms stepwise refinement [Reference 2] and structured programming [Reference 4] are associated with this approach. 

The remainder of this chapter illustrates the development of a program by rewording (to be consistent with Pascal notation) an example c.A.R. Hoare presents in the book Structured Programming [Reference 4, "Notes on Data Structuring"]. 

The problem is to generate the prime numbers falling in the range 2 .. n, where n >= 2. After a comparison of the various algorithms, that of Eratosthenes' sieve is chosen because of its simplicity (no multiplications or divisions). 

The first formulation is descriptive. 

1. Put all the numbers between 2 and n into the "sieve." 

2. Select and remove the smallest number remaining in the sieve. 

3. Include this number in the "primes." 

4. Step through the sieve, removing all multiples of this number. 

5. If the sieve is not empty, repeat steps 2-5. 

Although initialization of variables is the first step in the execution of a program, it is often the last in the development pro-cess. Full comprehension of the algorithm is a prerequisite for making the proper initializations; updating these initializations with each program modification is necessary to keep the program running. (Unfortunately, updating is not always sufficient!). 

