Computer Science Java Style
Introduction
Fundamental Notions and First Constructs

Notational Conventions for Task Description

It is useful to have a special notation for use in describing tasks which must be performed in a precise manner, yet which are best specified in a fairly natural language. Tasks which must be performed in the context of a computer system, such as text editing, file manipulation, compiling and running programs, are examples of tasks which must be performed in a precise manner. Below I specify one such mechanism of task description, one which facilitates the reading of tasks at two levels of abstraction.

Conventions

We will adopt a set of conventions for use in circumstances where is is desireable to describe a task of some precision using a fairly natural language. Each convention will be associated with a particular metasymbol. A metasymbol is a symbol which provides a clue regarding how to interpret information.

  1. Metatextual Double Quotes. Text within double quotes, "...", describes what is to be done at a fairly high level of abstraction.
  2. Metatextual Square Brackets. Text within brackets, [...], partially specifies the state that the system must be in before a task can be undertaken. That is, text within brackets specifies a precondition. A precondition is a situation which is presumed to be true prior to undertaking a task.
  3. Metatextual Angular Brackets. Text within angular brackets, <...>, describes what you are suppose to do.
  4. Metatextual Parentheses (Round Brackets). Text within parentheses, (...), describes how to do something.
  5. Metatextual Braces (Curly Brackets). Text within braces, {...}, suggests why you might want to do something.
Of course, a line of text can at once be interpreted as what you want to do and how you might go about doing it. My choice to mode in which to present a line is often arbitrary. Overall, I believe that the metatexual guideance is helpful.

Reading the Descriptions

If you simply read the lines in double quotes, you will understand the task at a high level of abstraction. At this level you can quickly place the task in a broad perspective, and you can easily apprehend its essential fabric. Once you understand the goals of the task, once you apreciate the knowledge you will derive as a result of performing it, you can elect whether or not to perform the task. If you should decide to proceed with the task, the double quoted text describes abstractly what is done in each step of the task. For tasks which are computer system independent, you can simply proceed with the details provided. For tasks which are computer system dependent, you may either follow the detailed descriptions literally, if you are using emacs and unix, or you may follow them generally, translating what is to be done in the context of the editor and operating system of your choice. Section 2.6 provides further insight, by way of example, of flexibly approaching system specific operations.

Example Task Description

The following text describes a procedure that would pertain to you if you were enrolled enrolled in the course for which I wrote this book. It describes a procedure for "doing" a first programming assignment.
  1. " Familiarize yourself with the challenge at hand. "
    [ You have a copy of the "challenge". ]
    < Carefully study the problem associated with the challenge. >
    ( Read the problem. solve, by hand, several instances of the problem. )
    { Unless you fully understand the problem, you will likely fail to solve it. }

  2. " Write the program which solves the problem of the challenge. "
    [ You fully understand the problem to be solved. You have completed the first laboratory challenge. ]
    < Write, run and test the program called for in the assignment. >
    ( Mimic the mechanics of the approach used in the first "laboratory challenge". )
    { This approach will enhance your programming effectiveness by reducing typing and focussing you on program dependent tasks, which vary from one simple Java application to the next. }

  3. " Prepare your document. "
    [ Your program is correct, clearly written, and properly tested. ]
    < Prepare your Programming Challenge #1 document for submission. >
    ( Compose a title page with your name, the title of this class, and an abstract describing the program. Generate hard copies, on 8.5 by 11 inch paper, of your title page and the source program. Place the former atop the latter. Place three staples on the left margin, reasonably spaced { so that I can read your program like a typical book }. )
    { I will not accept your program unless it is properly submitted. This standard presentation will render my grading of your many programs tractable. }

  4. " Submit your document. "
    [ Your program is properly prepared for submission. ]
    < Submit your program. >
    ( Bring your program to class. )
    ( Place it in the "current assignment" folder after class. )
    { You want to have complete experiences such as this because they contribute fundamentally to your learning experience. }

You can read just the double quoted description of what is to be done. This is typically what you will want to do as a first step in undertaking a tast. After the top level read, you can proceed with the details. A note of caution relative to preconditions is in order. Subtask 1 begins: This is a precondition which is hard to ignore. Interestingly, there are times when you may be tempted to ignore a precondition. For example, the reason for a precondition may not be clear to you, or perhaps you do not know just how to satisfy the precondition. This is usually a bad idea! Ignoring a precondition will often come back to haunt you (obstruct your progress) at a later time.

Craig Graci
Last modified: Tue Jan 21 13:01:34 EST