Google
 

Ada in Action Practical Programming Examples (Do-While Jones)

in

SHORT CONTENTS
Chapter 1 : Introduction
Chapter 2 : Numeric Considerations
Chapter 3 : IO Utilities
Chapter 4 : Programming isn't software engineering
Chapter 5 : Testing software components and programs
Chapter 6 : Conclusion
Chapter 7 : Epilog

The rest of this book is divided into four main topics. The first topic is numeric considerations. The examples Chapter 2 illustrate the things you need to think about whenever your program does non-trivial calculations. This includes obvious things like how many bits you will need for integers, and what floating-point data type to use, but it also includes some things you probably haven't been exposed to before. The idea of letting the compiler check the consistency of the dimensional quantities in equations is a new innovation made possible by the Ada language.

Another difficult problem most programs have to deal with is the user interface, so it is the second topic. People aren't as predictable and consistent as mechanical devices are, which makes user interfaces difficult to design. This is an area with a lot of potential for reusable software. Chapter 3 is full of utility routines that I think you will find very useful.

Contrary to what you've often heard, the whole is more than the sum of its parts. Even if you have all the pieces, they aren't worth much if you don't know how to put them together. Chapter 4 shows several examples of small-scale programming, and one example of more rigorous software engineering, which is the third topic.

The last topic is testing. I saved it for last because writing code is easy; making sure it works correctly is hard. Over the years I've used a variety of methods to check code, and Chapter 5 talks about them.

A quick peek at the back of the book shows there are hundreds of pages of examples of Ada source code. The first examples are simple, and they get more complex as you read toward the end of the book. "Complex" has come to mean "difficult", but that's not the case here. The later examples are properly called complex because they were composed by combining the smaller building blocks found near the beginning to create bigger, more powerful, building blocks. This means it will be easiest to understand if you read the book from front to back without skipping around.

When choosing the examples, I didn't go through the list of Ada reserved words and try to come up with an example for each one. If I did, the first example would have an abort statement in it, the second would show how to use the abs operator, and so on. These contrived examples wouldn't do much more than show syntax, which you should already know.

Contrived examples often do things strange ways just for the sake of illustrating a point, and this sometimes teaches bad programming habits. For example, recursion is often demonstrated by recursively computing N factorial (N! = N * (N-1)! until N = 1). That's a good way to show recursion, but a terrible way to compute N factorial. Students often miss the point of the example. If the homework assignment is to write an excellent program to compute N factorial, guess how most of the students will do it.

To Download this E-Book Click Here.

Reply

The content of this field is kept private and will not be shown publicly.