A cognitive model for structuring an introductory programming

A cognitive model for structuring an introductory programming
curriculum
by CHARLES B. KREITZBERG
City University of New York
New York, New York
and
Educational Testing Service
Princeton, New Jersey
and
LEN SWANSON
EDUCOM
Princeton, New Jersey
of this paper to propose a theory explaining some of these
more fundamental problems, and to suggest the need for
research supporting a methodology for overcoming them.
THE PROBLEM
Introduction
From its inception the electronic digital computer has been
involved in education, although its role has been the subject
of some debate.! Academically, the computer has been used
as a device for conducting or augmenting instruction, as a
calculating device adjunctive to courses in engineering and
the sciences, and most recently as an object for study in its
own right. 2 Increasing attention is now being focused on
undergraduate training in computer use, partly as a result
of the recommendation of the President's Science Advisory
Committee3 that computing education be provided to all
college undergraduates. We can expect that the number of
students who undertake incidental study of programming
as a part of their undergraduate curricula will continue to
increase rapidly.
While the demand for programming instruction is increasing, little research has been conducted on how that
instruction might be improved. There have been some investigations of programming behavior,4 but these have mainly
been concerned with how experienced programmers behave
rather than how programming skills are acquired or how
learning these skills may be facilitated. Many instructors
express an uneasy feeling that the objectives of the intrad uctory programming course are often not met; that many
students fail to develop programming competency.
It is, therefore, important that we look for the sources of
learning difficulties so that the courses we teach may be more
effective. Motivational and instructional pacing problems,
resulting from the frequent occurrence of students of unequal
aptitude and experience heterogeneously grouped in large
classes, clearly a~e factors. However, theories founded on
educational psychology seem to suggest that more funda~ental
Rote and meaningful learning
Educational psychologists classify learning along several
dimensions. One of the most important of these dimensions
is the rote-meaningful continuum. Learning which is rote is
verbatim memorization. In contrast, meaningful learning is
non-verbatim; that is, the learner is able to restate the
material in his own terms. Material which is meaningfully
learned may be reformulated and used by the learner. In
order to learn material meaningfully, the learner must integrate the material 'with ideas which he already understands.
Thus the background of the student must be adequate if the
material is to be meaningfully learned.
Rote learning and meaningful learning are not absolutes.
Learning may be more or less meaningful or rote, depending
upon a number of factors. The precise degree of meaningfulness "\Vill" vary with the individual student. Factors which
lead to rote learning tendencies are: material which is verbatim by nature (such as most foreign language vocabulary),
lack of background on the part of the student, poor presentation of the material, and anxiety on the part of the student.
A complete discussion of the rote-meaningful dimension of
learning may be found in Ausubel. 5
Numerous studies have shown that meaningfully learned
material is remembered far longer, recalled with less difficulty, and utilized more effectively than is material learned
in a rote manner. However, in order for a student to learn
a subject meaningfully each fact to be learned must be integrated with the student's previous knowledge. Each new
idea must be either an elaboration, an addition, a contradiction, or an example of an idea already in the student's
background.
problenls, arising from the absence of certain require-
.n-:..ents for effective learning, are at play. It is the objective
307
From the collection of the Computer History Museum (www.computerhistory.org)
308
National Computer Conference, 1974
Learning to program is not typical of other learning
because it has decidedly rote and decidedly meaningful components. The syntactical elements of the language cannot
easily be presented in a meaningful manner, or related substantively to other constructs in the beginning student's
experience. For example, it is difficult to see how the fact
that a FORTRAN statement must begin in (or beyond)
column 7 can be presented in a meaningful manner. It is an
arbitrary fact which must be memorized by the student.
However, the assembly of statements into a program requires
a skill quite beyond the recall of arbitrary facts. It is impossible to learn how to program in a "verbatim" manner because programming is fundamentally a process of selecting
and structuring statements chosen from those available
within the language. Even general forms must be adapted
to the particular requirements of the problem before they
can be used in a program. For this reason it is important
that the learning of programming be meaningful rather than
rote.
We have pointed out that there are several factors which
may cause material which could be learned meaningfully to
be rote learned by the student. One of these factors is the
lack of adequate background for the material, or insufficient
context. Another factor which may inhibit meaningful learning
is insufficient vertical transfer-an inability on the part of the
student to transfer his understanding of a concept to an
application of that concept in a program. A third inhibitory
factor in the meaningful acquisition of concepts is a state of
anxiety on the part of the student, which in this context we
have called computer shock.
It must be recognized that these factors are not absolute.
Material is rarely learned either completely by rote or completely meaningfully. In general, the rote-meaningfui dimension is a continuous one, and the inhibitory factors to meaningful learning may operate to a greater or lesser extent depending upon factors unique to the individual student or to
the learning situation. However, to the extent that these
factors are operative they will tend to make it more difficult
for the student to learn programming. Therefore, a programming curriculum which minimizes the effects of these
factors should be more successful in meeting its objectives
than alternative approaches. Before recommending a curriculum which minimizes these factors we will elaborate on
them.
Insufficient context
Insufficient context results from a lack of related ideas in
the student's background which can serve as a base ("anchor") for the new programming concepts and techniques
being learned. Context derived from internalized concepts
and ideas can provide substantive links between existing
cognitive structure and the new meanings being encountered.
For the beginning student context must be derived from
prior knowledge and experience; as the student progresses
context can be constructed from the set of basic and unifying
principles that underlie the programming discipline, and as a
result comprehension of more subtle concepts is possible. 5
The lack of relevant prior knowledge on the part of the
beginning student makes learning and retention more difficult.
The presence of a sufficiently inclusive context makes it
possible for new ideas to be reconciled with existing ideas
and integrated into the cognitive structure more rapidly and
efficiently. Bransford and Johnson have shown dramatically
that establishment of context prior to exposing students to
material to be learned facilitates both comprehension and
retention of the material. 6
Beginning students usually have few relevant anchoring
ideas that could support efficient learning of programming.
The study of a programming language is in this sense quite
different from the study of a second verbal language. Bernard
argues that the latter "consists fundamentally in the acquisition of an additional set of symbols for old, familiar meanings."7 In acquiring a second language the student has already mastered basic concepts and syntactic code and thus
has the necessary relevant context as part of his prior
knowledge. In programming, however, the student has no
easy referents for such concepts as the interchange of two
variables or the searching of a matrix. These concepts thus
form basic meanings whose learning must precede the purely
syntactical concerns and provide the anchorage for subsequent learning. This explains why a programmer proficient
in a single language can usually learn a second programming
language very rapidly. The "vocabulary" and syntax of a
programming language is usually quite simple once a basic
set of constructs is learned, and the student has an appropriate context into which he can integrate the new set of
symbols.
The lack of adequate context for the beginning programmer
stems from the fact that a computer is unlike anything which
the student has previously encountered, nor is programming
very much like any problem-solving behavior in which the
student has previously engaged. Yet computers are designed
as they are for very good reasons-to provide them with
certain well-defined capabilities. Unfortunately, it seems
that most students are not presented with the relevant
anchoring ideas that would help them see the language
requirements as a necessary concomitant of the computer's
functions.
Unless sufficiently inclusive unifying context is provided,
a beginning student without the relevant anchoring ideas
must either learn in a rote manner or press into service less
relevant ideas, relying on his own ability to reconcile the
new ideas with existing ideas in his cognitive structure. In
the latter case the new ideas being encountered will be less
firmly anchored and more quickly forgotten. If the student
must learn by rote, deferring integration until he has acquired
more background, then reconciliation and synthesis of ideas
becomes difficult and his ability to apply his new "knowledge" is correspondingly impaired.
Insufficient vertical transfer
The second hypothesized source of difficulty in learning
programming is insufficient "vertical transfer." Transfer is
the facilitating effect of previous learning on new learning.
From the collection of the Computer History Museum (www.computerhistory.org)
~A~
Cognitive Madel for Structuring an Introductory Pl'ogtctuuuiug Curriculum
Transfer is usually defined as Hhorizontal" or "vertical."
Horizontal transfer occurs when a previously learned task, A,
facilitates the learning of a new (and different) task, B.
Vertical transfer occurs "vhen rules or concepts learned at a
"lower" cognitive level (such as concept learnill{J) are applied
at a "higher': cognitive level (such as problem solvill{J).* In
the case of programming, the objective of instruction is to
help the student move from the level of knowledge (of
syntax) to the level of application, which is generally regarded as a higher cognitive level. In another context, the
ability to playa musical instrument represents a (vertical)
transfer from the level of knowledge (of musical notation
and instrument mechanics) to the level of skill or application.
In this case the skill is partly motor and partly intellective.
Transfer from the intellective to the skill level is essential
when applying knowledge of a programming language to a
specific problem. In most cases the beginning student's
knowledge of the language consists primarily of vocabulary
and syntax. Even if the solution to a specific problem is
given to him in the form of a verbal algorithm-indeed, even
if the implementation itself is shown to him-he has difficulty accomplishing the transfer because the gap between
knowledge of vocabulary and syntax and problem solution
is too great.
Gagne has said that "the components \vhich appear to
make problem solving possible are the rules that have previously been learned. Problem solving may be viewed as a
process by which the learner discovers a combination of
previously learned rules that he can apply to achieve a
solution for-.a. 410V-cl.pr.oWem-situation.' '(Refere.nee-8,-page· .
214)
Thus a proficient programmer, working on a problem
that is 'within his experience, is hypothesized to operate primarily at a synthetic level. That is, he has learned or discovered the techniques or "meta-rules" that might 'be applicable to his specific problem, and applies these techniques
in a relatively straightforward manner. It is precisely these
meta-rules which permit him to operate at the level of
synthesis much' of the time, using analytic skills only when
new constructs or techniques are required.
The beginning student, however, must try to break his
problem down into a much finer set of subtasks that are
recognizable to him in terms of his knowledge of the basic
vocabulary and syntactic rules of programming before he
can begin to develop the larger structures. In effect, he is
constructing new techniques for solving non-intuitive problems, and this is an intellectually difficult task. Moreover,
he must hold all potentially relevant rules in mind at one
time when searching for those which might be applied to his
problem.
The specific rules may not be obvious to the student
because there are fundamental differences between human
problem-solving techniques and computer solutions. People
~end to solve problems by a "top down" approach, seeking
* A number of authors have constructed cognitive hierarchies-learning
tasks of increasing complexity. Two of the best known hierarchies are
due to Bloom and to Gagne. 8 ,9 An analysis of programming texts in terms
of Bloom's taxonomy may be found in Rademacher,lo
.
309
patterns which may then be considered as problems of reduced complexity. Computers, on the other hand, have almost
no ability to consider patterns, but rather operate in a sequential manner. As an example of this, consider the problem
of determining which of the following numbers is largest:
1
12596
14
A person scanning this list would automatically and effortlessly pick out the second number as the largest, not because
of its value but because of its length. A computer program
to perform this same task would need to be written as a
complex series of sequential operations; the following algorithm is an example:
i:=l; j:=a[l];
for k:=2 step 1 until n do
begin
if ark] > j then
begin i:=k; j:=a[k]
end;
end;
Such algorithms, while they are "natural" to the experienced
programmer, are highly non-intuitive to the beginner who
does not recognize the relevant rules. To expect the student
to be able to create such algorithms without careful preparation is unreasonable; yet attempts are often made to teach
this algorithmic approach by showing the student a complete
program or two and exp.ecting him to somehow absorb these
non-intuitive concepts.
,
Even when a student is shown the solution to a problem
1iehasdifficultytransferriniihiit sofutionto Other situations. 8
A stimulus-response chain may be created, in which the
student learns to respond ip. certain ways to certain problems
without understanding the underlying rationale for the response. When asked to generalize from the solution, or solve
related but perhaps more complex problems, he is at a loss.
The problem of learning from a given solution, or constructing generalizations of it, is particularly acute when
the solution is complex or counter-intuitive, as for example
in a sort routine. A study by N ewsted suggests that there ~s
a critical point of program complexity beyond which the
student is unable to grasp the solution as a unit and requires
additional documentary aids. ll
It therefore seems reasonable to conclude that the learning
of a programming language can be significantly improved if
the student is encouraged to operate primarily at the level
of rule application. To do this he must draw on knowledge
of larger (non-intuitive) constructs than those represented
simply by the vocabulary and syntax of the language. He
must be able to subordinate his problem under such generalized techniques or meta-rules as sorting, interchanging,
searching, etc. In a sense he must be presented with an extended "syntax" which includes these basic techniques or
processes.
Computer shock
Beginning programming students are particularly susceptible to a phenomenon similar to one which in mathe-
From the collection of the Computer History Museum (www.computerhistory.org)
310
National Computer Conference, 1974
matics courses is referred to as "number shockiJ or "number
anxjety." The student tends to panic in the face of uncertainty about his understanding of the new and generally
non-intuitive ideas he is encountering, and lacks confidence
in his ability to apply these ideas to specific problems. The
phenomenon is familiar to programming instructors who have
seen students perform well on knowledge tests but struggle
to construct even a relatively simple program. Faced with
uncertainty and accompanying panic, the student tries to
learn by rote lest he lose grasp of the material completely.
The result is that synthesis of ideas is difficult if not impossible.
Computer shock may be partly due to general unfamiliarity
with or lack of prior context for the subject. It is also caused
by the necessity to operate with a degree of precision and at
a level of detail which seems demanding to the student.
We tend to forget how really technical programming can
appear to the beginning student. He is exposed to a wealth
of new information on complex machines and processes, and
asked to operate in a cognitive mode which is different from
his normal way of thinking. More important, he must learn
a variety of rules and a difficult syntax before he has acquired
the ability tn-apply his new knowledge in concrete situations.
When he is asked to solve a specific problem it is usually of
a complex variety which requires the synthesis of many
increasing subsets of the language are developed, would be
an optimal mode of presentation. A student will encounter
an idea not once, but several times at increasing levels of
complexity. Some attempts have been made to provide a
subsetl2 of the language initially and then progressively
extend that subset; this is a useful approach but it is essential
that the subsets be so selected that the student will see the
logic of each extension. It is not sufficient to merely defer
certain details to a later time. Each concept should be presented as an elaboration of the previously learned ideas.
Thus the student presented with materials in the "spiral
curriculum" learns ever-increasing supersets of the subject
as though he were walking up a spiral staircase, traversing
the same points over and over again but at successively
higher levels. The effectiveness of this approach has been
substantiated by psychological studies. 5
Learning materials should begin with concepts which are
essential to an understanding of the subject. These concepts
are of the follov.ing types: "What is a computer?" "What
is a program?" "What sort of things can a computer do?"
The introduction of these concepts must be carefully made,
basing each new concept upon concepts with which the
student is already familiar and showing the logical necessity
of each new idea as a consequence of the properties that we
desire in a computer. This minimizes the problem-of learning
makes meaningful learning difficult. ,The three -factoTs discussed above-insufficient context,
insufficient vertical,transfer, and computer shock-can make
it difficult for the b~ginning student to learn programming.
A numb~r of factof$, including, ,the student's aptitude, the
effectiveness of classroom lectures, and the availability of
adequate laboratory facilities, will effect the ease and rapidity
of learning. However, much can be done to overcome these
specific bars to learning by improving the presentation of
materials and methods of instruction. The following section
suggests some guidelines for overcoming the problems discussed.
In accordance with this philosophy, the introduction of
new ,concepts should be preceded by advance organizers which
provide a brief introduction to the concepts in terms of
previously learned ideas.' As the new ideas are then encountered the student has some notion of their relationship
to other ideas with which he l~"familiar. A number of psychological studies -(including the Bransford and Johnson 6 study
cited earlier) have demonstrated that the use of advance
organizers has a substantial effect on both comprehension
and retention of the material that follows. 13
-Tdeas-jiit6 -aconerent sorutiori:--TIie-reslliris--ah -aIiuety -"tnat------interms-nf-cImLexLaal pI er equisiLes.-
Vertical transfer
PROPOSED SOLUTIONS
Context
Since context is such an important part of learning, the
organization of learning materials into discrete compartmentalized sections, each one containing all information
relevant to a particular aspect of the language, will not
improve learning and retention. On the contrary, in order to
learn effectively the student must be presented with an idea
and shown how it is similar to ideas he already has, how it
differs, and how it extends, elaborates, or modifies his concepts. This makes it possible for the student to learn in a
meaningful way and then use this new idea as an anchor for
more elaborate ones.
The need for continually providing the student with adequate context suggests that a spiral approach, in which ever-
The problem of facilitating vertical'transfer, so that the
student is able to utilize the concepts which he learns, can
be resolved by judicious selection of exercises which implement fundamental programming structures. These exercises
should drill the student in such areas as variable assignment,
exchanging values, statement repetition, and basic program
structure. The techniques which underlie the selection of
these exercises can be found by inspection of professionally
written programs to isolate common program structures
utilized.
We have postulated the existence of "meta-rules" which
are basic constructs which programmers use to build programs. An example of such a meta-rule in FORTRAN might
be the zeroing of an array by use of a DO loop:
DO 10 I=l,N
10 A(I) =0.
From the collection of the Computer History Museum (www.computerhistory.org)
A Cognitive Model for Structuring an Introductory Programming Curriculum
or the interchange of two variables:
TEMP=A
A=B
B=TEMP
If such meta-rules can be identified and taught to the student
he should be able to develop programs far more rapidly and
with greater ease, since he no longer needs to invent these
constructs each time he needs them.
311
gations into the specific concepts required to provide adequate context, identification of the meta-rules which will
enhance vertical transfer, and construction of exercises which
will facilitate the use and adaptation of the meta-rules in
various contexts. Such research is much needed in a society
in which "computer literacy" is rapidly becoming a requirement of the educated person.
ACKNOWLEDGMENT
The authors would like to thank Professor Ben Shneiderman
for his contribution to some of the ideas formulated in this
paper.
Computer shock
The effects of computer shock may be minimized in several
ways. First, the mystery which tends to surround the word
"computer" should be dispelled as quickly as possible by
describing the simple, readily understandable functions it is
designed to perform and the manner in which these functions
are built upon to create the more elaborate structures associated with actual applications. This will provide the student
with a better sense of the capabilities and limitations of the
computer, and place in perspective the reasons it is designed
as it is.
Second, the basic operations the computer performs should
bedesc~lbed in terms of similar openltlonswlth--wnidl the
student is already familiar. The operation of an adding machine, for example, provides a good analogy for introducing
the concepts of input, output, and program control.
Finally, written materials used in teaching should be as
attractive and well-organized for instruction as possible. The
materials typically found in reference manuals,· for example,
tend to be imposing to the student and are therefore unsuitable for instructional use.
SUMMARY
This paper has hypothesized three factors which inhibit the
acquisition of programming skills. We expect that curricula
which minimize the effects of these factors will be the most
successful in teaching introductory programming.
Empirical evidence is required to support these hypotheses.
Among the research which should be carried out are investi-
REFERENCES
1. Oettinger, A. and N. Zapol, "Will Information Technologies Help
Learning?," Teachers College Record, Vol. 74, No.1, September 1972,
pp .. 5-54.
2. Mosmann, C., "Computers .and the Liberal Education," The Educational Forum, Vol. 36, No.1, November 1971, pp. 85-91. _
3. President's Science. Advisory Committee, "Computers in Higher
Education," U.S. Government Printing Office; February 1967.
4. Weinberg, G., The Psychology of Computer Programming, New York,
__ !l.}7JL'yy._n_1i~~i~_Il~_~_~~~~old.
5. Ausubel, D. P., Educational Psychology: 4- Cognitive View, New
York, 1968, Holt, Rinehart and Winston.
6. Bransford, J. D. and M. K. Johnson, "Contextual Prerequisites for
Understanding: Some Investigations of Comprehension and Recall," Journal of Verbal Learning and Verbal Behavior, Vol. 11,
) 97~,. pp. 717-726.
7. Bernard, W., i'psyehologIcaCPr~ples-orl:;anguage-r;earnini(aoo:=·-~--:-~=~~
the Bilingual Reading Method," Modern Langooge Journal,Vol:35,
1951, pp. 87-96.
8. Gagne, R. M., The Conditions of Learning, New York, 1965, Holt,
Rinehart and Winston.
9. Bloom, B. S., et al., Taxonomy of Educational Objectives: The Classification of Educational Goals, New York, 1956, Longmans, Green
and Co.
10. Rademacher, R. A., Cognitive Levels in Computer Education for
Business, Ph.D. Dissertation, University of Nebraska, 1971.
11. Newsted, P. Unpublished manuscript.
12. Kreitzberg, C. and B. Shneiderman, Fortran Programming: A
Spiral Approach, New York, in press, Harcourt, Brace, Jovanovich.
13. Ausubel, D. P., "The Use of Advance Organizers in the Learning
and Retention of Verbal Material," Journal of Educational Psychology, Vol. 51, 1960, pp. 267-272.
From the collection of the Computer History Museum (www.computerhistory.org)
From the collection of the Computer History Museum (www.computerhistory.org)