Skip to main content
Top

2011 | OriginalPaper | Chapter

4. Cooking Up Programs

Author : Derek Partridge

Published in: The Seductive Computer

Publisher: Springer London

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Through the development of a simple example, this chapter gives all the details necessary to appreciate the essentials of programming. All programs are simply a list of instructions that the computer will follow mindlessly. The instruction list may be reduced in length by making repeated segments into a single instance of a subprogram which can be re-executed any number of times. Other repeated instruction segments may be included in a loop structure that directs the computer to repeatedly execute the instructions included within it. Use of a loop structure introduces a branch point where the execution sequence may either go around the loop or not. This list of instructions, the program, then determines a complex flow structure (as the collection of all potential flow paths), but makes no effort to expose it. It is the flow structure (in conjunction with branch conditions and specific storage-box values) that directly determines the program behaviour that emerges. Stepwise refinement from program plan to programming language instructions is introduced and contrasted with ad hoc concoction of programs. Some program style guidelines (just COMMENTs and indentation as a layout feature) are introduced as an aid to human comprehension. Subprograms and loops reduce program size but increase flow structure complexity. Consequently, the programmer attempting to eliminate an error, or otherwise modify the emergent behaviour, can only work by rearranging the list of instructions but must think in terms of the flow structure repercussions.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Footnotes
1
This true story is told at much greater length and with full details by Leonard Lee in The Day the Phones Stopped (Primus: New York, 1992).
 
2
One important difference between programs and recipes is that programs are constructed to be followed precisely, whereas recipes will always (and are usually expected to) admit some latitude for interpretation. You never get precisely the same cake twice, but you should always get precisely the same computation from an unchanged program – however many times you require the computer to execute the program (to exercise the jargon).
 
3
Mrs Beeton’s Household Management: a complete cookery book, by Isabella Beeton, Ward Lock: London. This famous nineteenth century tome of 1,680 pages, which ranges from cookery through to “servants’ duties”, has been through many editions and was a UK standard for decades.
 
4
I employ the convention of underlining for all main program and subprogram names, and bold for the name itself where the subprogram is specified, but not bolded for references to the name. In this way we can visually distinguish between a subprogram name designating a segment of instructions as a subprogram , and a subprogram name that is an instruction for the computer to go to the named subprogram and execute the instructions it contains.
 
Metadata
Title
Cooking Up Programs
Author
Derek Partridge
Copyright Year
2011
Publisher
Springer London
DOI
https://doi.org/10.1007/978-1-84996-498-2_4

Premium Partner