Design Recipes

Basic design recipe for Scheme functions

(or functions in most other languages, for that matter!)

To solve any problem, in any area (not just programming), requires three steps:

  1. Figure out what you need to do.
  2. Do it.
  3. Check that you did it right.
Most of the buggy programs in the world can be blamed on skipping either the first or the third of these steps.

The ten steps of version 3 of the Design Recipe are merely an elaboration of these three:

(1) Analyze the problem
(1a) Understand the assignment informally
(1b) Write a function contract specifying what kind of information goes in and what kind comes out
(1c) Analyze the data types going in and out
(1d) Write examples of how the function will be used, with correct answers
(2) Write the function definition
(2a) Write the function's Skeleton
(2b) Choose and use an appropriate Template
(2c) Fill in the Function Body
(3) Check your work
(3a) Proofreading
(3b) Syntax checking
(3c) Testing

Last modified: Wed May 30 13:17:20 EDT 2001
Stephen Bloch / sbloch@adelphi.edu