Book contents
- Frontmatter
- Contents
- Preface
- 1 A modern approach to computing
- 2 Specifications I
- 3 Diagrams
- 4 Specifications II
- 5 PDL
- 6 Code generation
- 7 Verification
- 8 Examination of templates and target code
- 9 Abstract data types
- 10 The mathematical basis of abstract data types
- 11 Utilisation of existing programs
- 12 A small scale study – topological sorting
- Appendices
- References
- Index
- Frontmatter
- Contents
- Preface
- 1 A modern approach to computing
- 2 Specifications I
- 3 Diagrams
- 4 Specifications II
- 5 PDL
- 6 Code generation
- 7 Verification
- 8 Examination of templates and target code
- 9 Abstract data types
- 10 The mathematical basis of abstract data types
- 11 Utilisation of existing programs
- 12 A small scale study – topological sorting
- Appendices
- References
- Index
Summary
We have been discussing the specification of programs and the refinement of specifications. These are clearly processes that precede the coding into the final programming language. On the assumption that the final programming language will be imperative rather than declarative, we introduce another stage in the programming methodology before the final coding. This stage will use a PDL –a Program Development Language (or Program Design Language).
In this chapter we compare imperative languages and declarative languages and show why the transition from a declarative specification to final (imperative) code should be performed in two stages (i.e. via PDL). We then introduce one possible PDL but point out that a PDL should be chosen to suit a particular team or project. PDL versions of all the specifications in earlier chapters are shown as examples. Chapter 6 deals with the translation of PDL into various real imperative languages.
Imperative and declarative languages
The great majority of programs in existence are written in imperative style. This is because FORTRAN, COBOL, PL/1, Algol, Pascal, Ada and assembly languages are all imperative languages.
In case this seems to include the whole world of programming languages, let us point out that the alternative to the imperative languages is the use of declarative programming languages which include functional languages (e.g. (Pure) Lisp, KRC, Hope, Miranda, FP) and the logic languages (e.g. Prolog).
In this context the word imperative is intended to convey the sense of a command or instruction to do something straight away.
- Type
- Chapter
- Information
- Program Construction , pp. 72 - 87Publisher: Cambridge University PressPrint publication year: 1987