by John English
The book is in three parts. The first part deals with the fundamentals of Ada programming: how to do input and output, how if statements and loops work, what procedures, functions and packages are all about, how to define your own data types, how to handle exceptions. At this stage the examples are necessarily tiny; although I deal with program design in chapter 3 when I reach the first example large enough that design merits a separate discussion, the next few chapters concentrate more on introducing the building blocks of Ada using variations on earlier examples. Instructors should of course continue to emphasise the design techniques I’ve introduced when students are expected to develop new programs as exercises. At the end of the first part, an electronic appointments diary provides a larger example which merits a chapter entirely devoted to design and debugging, although at this stage the design is deliberately na‹ve.By the end of the first part, the reader will have been presented with two examples which will be carried further in the next two parts: an electronic appointments diary and a simple desk calculator. These next two parts concentrate on introducing maintenance problems and introducing new approaches and techniques for dealing with these problems. In my experience the real problems of programming only become apparent when you have to maintain an existing legacy of code, and you only learn to design programs so that they are capable of being maintained in the future when you yourself have been on the receiving end of maintenance problems.
The second part deals with abstract data types; it begins by taking the example from the end of the first part and proposing some possible maintenance scenarios. I use these as an excuse for revising the designs I’ve already proposed in the first part. The early chapters in the second part deal with improving the appointments diary from chapter 8, while the last chapter returns to the calculator example from the first part. Some new implementation techniques are introduced: linked lists, generics, opaque types and recursion are all investigated. The effort involved in dealing with the proposed maintenance scenarios should reveal what a mess poor programming practices can get you into, and should hopefully provide an incentive to master ways of designing programs so that this sort of effort will be minimised if you ever have to make maintenance changes to programs that you write.