The psychology of computer languages for introductory programming courses

The psychology of computer languages for introductory programming courses

THE PSYCHOLOGY OF COMPUTER LANGUAGES FOR INTRODUCTORY PROGRAMMING COURSES JOHNS. MURNANE* School of Science and Mathematics Education, Institute of ...

1MB Sizes 0 Downloads 44 Views

THE PSYCHOLOGY OF COMPUTER LANGUAGES FOR INTRODUCTORY PROGRAMMING COURSES JOHNS.

MURNANE*

School of Science and Mathematics Education, Institute of Education, University of Melbourne, Parkville, Victoria 3052, Australia Abstract Factors involved in the design of computer languages have evolved from largely practical to almost completely technical at the expense of the psychology of language acquisition and use. In particular the relationship of computing languages with natural language deserves far more prominence than it currently receives, especially languages designed for ab initio programming courses. This paper considers the type of programming language which would emerge under two opposing schools of thought: those of Noam Chomsky and Jean Piaget. THE DESIGN OF COMPUTER

LANGUAGES

The author of a new computer language usually has the objectives of increasing productivity in some area and enhancing program correctness. This is true of languages intended for introductory programming courses where ‘productivity’ would include ease of acquisition and use and the early establishment of good programming technique. The design of early computer languages such as Fortran (commercial) and Basic (educational) were influenced as much by the developer’s knowledge and perception of what was technically feasible as by the intended use of the language. Over the last 20 years theoretical Computer Science has flourished, allowing this restriction to be considerably relaxed. From the emergence of Algol in the late 195Os, almost all language development has been driven by technical considerations-theories originating in Computer Science or in advances made in the application area itself. While human factors and in particular human language have received some prominence, all too often they have ultimately been buried under scientific dogma and pragmatism. Weinberg, in a book entitled The Psychology of Computer Programming, published in 1971, lamented that “the programming language theoreticians have too long ignored the psychological side to their trade.” Since then there have been a number of largely empirical studies into the psychology of programming, notably Brooks (1983) and Pennington (1987), which examine possible models for the cognitive structures involved, but in general, with the possible exception of Logo, there has been little consideration given to the relationship between acquiring a natural language, and learning and using a computer language.

*Acknowledgements-My thanks to fellow lecturer John Warner for providing a counter example to all my assertions.

213

,J. S. MUI-n:tr~e

214

As Computer

Science

developed,

various

principles

for

constructing

lan-

guages evolved. Several, often competing, factors were involved, among them the desire to actively enforce the production of stylistically correct code and to reduce the possibility of making errors, as in Pascal, enhance the utility of the language as in C, or pass the responsibility for solving the problem to the language, as in Prolog. (Smalltalk could almost be said to have grown from all of these.) Increasingly, responsibility for the actual implementation of the program passed from the programmer to the system. Hence contemporary computer languages show a tendency to become more and more astringent. A full discussion of this assertion deserves at least a paper to itself but I provide two brief examples. MacLennan (1983,

p. 510)

argues

the advantages

of abstract

data types as in

Prolog: “The primary value of abstract data types is that they are implementation independent, which makes them easier to maintain and more portable The only way to describe a data type in Prolog is to give an abstract, algebraic description of the properties of its operations . . . [The result] is the strict adherence to the Security Principle.” This leads to a situation where the data, and its structure, i.s not visible to the programmer. In the early stages of learning to program students require concrete, visible objects to work with. A strong case can be made on technical grounds for functional (or ‘applicative’) programming, based on predicate and lambda calculus. One of the goals is to program at a level above that provided by ‘procedural’ languages such as Pascal. A second is to reduce a program to an algebraic set of manipulations, eliminating variables. This produces a highly mathematised program, whose meaning in terms of natural language is far from obvious, even to those familiar with computer languages such as Pascal or Cobol. “It should be as simple to do things with [functional] programs as it is to do high school algebra” (MacLennan, 1983, p. 405). This is to not rate high school algebra on any absolute scale of simplicity. Some students will find algebra easy and some hard. But even if the overwhelming majority did learn to use algebra without undue difficulty, the fact remains that it must be explicitly taught as a specific cognitive diwipline and this would also be true of any applicative programming language. Such a language notation. p. 72). There

would not be accessible to anyone “Programming is not mathematics” are two applicative

languages

not grounded in its syntax and (Tremblay & Sorenson, 1985,

which have seen wide use in education

in

ab initio programming courses. Logo was intended as a version of Lisp accessible to Primary children, while Prolog has been used to bring the power of predicate calculus, including automatic theorem proving, into the classroom. Neither language is particularly readable. Both require students to master syntax which has little in common with their native written expression. “In general the applicative language statement languages remain most unfriendly for the normal user. Language designers have taken for a base of design the structure of computing systems and methods of compiling” (Henno, 1988, p. 552). The semantics

of an applicative

language

pose

an even

greater

problem.

Psychology

of computer languages

215

THE ROLE OF LANGUAGE IN THOUGHT These and other considerations raise the question of the precise role of language in thought and expression. Specifically, to what extent does language play a part in the solution of computing-related problems? The idea that “a man’s language moulds his perception of reality, or that the world a man inhabits is a linguistic construct” (Sampson, 1980, p. 23), a version of the SapirWhorf hypothesis, is very old and widely, if not universally, held.* If true, and language does determine or at least heavily influence the way humans think, then it is time that linguistics receive more emphasis in the development of programming languages, especially those designed for introductory programming courses. Programming, it should be noted, used in a broad sense and encompassing systems analysis, documentation, implementation, testing, etc., is a multi-disciplinary activity with no respect for boundaries placed on traditionally separate areas of cognition. There have been some empirical studies of particular syntax structures, for instance on nested IF statements (Sime, Green, & Guest, 1975), implicit vs. explicit bracketing (Tremblay & Sorenson, 1985, p. 103), and semi-colons used as terminators rather than separators (Gannon, 1975). This type of study tests the relative merits of particular syntax structures but does not relate them to the way students deal with language in general. Authors writing on computer language design often discuss natural language, both as a source of ideas and as a potential cause of ambiguity and misunderstanding. These studies do not generally consider theories of language acquisition. The process by which language is acquired is even more controversial than the Sapir-Whorf hypotheses, but one of the things that two of the main protagonists in the field, Noam Chomsky and Jean Piaget, had in common is the conviction that to study a discipline while ignoring the educational psychology (learning theory) for that discipline is meaningless: “it is common to distinguish ‘linguistics,’ taken as the study of grammar, from ‘psychology,’ which is concerned with behavior and learning. [This] would seem a senseless distinction” (Chomsky, 1976, p. 160). “We cannot oppose the search for connecting links between the mental mechanism and logico-mathematical structures, since this is precisely our task” (Beth & Piaget, 1966, p. 141). Nor has this escaped the in computer education theorists: “it has become critical for decision-makers education to understand how programming is learned” (Pea SC Kurland, 1984, p. 139). THE ROLE OF COMPUTING LANGUAGES A computer programming language has two functions: to communicate an algorithm in a form suitable for processing by a compiler, and to provide a vehicle of expression for a programmer. The latter implies that the program can be understood as a communication by a wider audience than just the author. Of

*“Words, spoken aloud or rehearsed in the imagination, often accompany our thoughts, but in no way embody them” (Dummett, 1989).

“I6

.I.

s.

Mul-n~lrle

the two functions, communication is by far the most important. Above all else, programs must be readable. The requirement that the meaning of a program be completely clear and unambiguous sets absolute bounds on what can and cannot be used in a computer language, but within these bounds there is still scope for expression. Usually even difficult to implement ‘features’ can be tolerated if they are useful, since their implementation essentially has to be solved once only. The language itself (as apposed to its translation by some automatic system), must be accessible to all who would use it. Programming has traditionally been considered as a ‘scientific’ activity, which strong links to mathematics. This was always something of an arbitrary judgment which has been strongly challenged in recent years. No studies have shown that students who perform well in the traditional sciences have any particular advantages when it comes to programming. Certainly there is no justification in confining programming classes to a ‘maths-science’ stream in schools. The tools which science provides should not be confused with the use to which those tools will be put. The development of a computer language and its associated translator-interpreter may be a scientific process, but the authoring of a program written in that language is not. This point may be debated but the construction of a written set of directions is essentially as much a language activity as is writing an essay. That a program is written for machine translation is incidental-what is being produced is a communication and communication is a language skill: The most basic goal of a programming language is communication between human beings . It is important to be able to write programs easily. It is necessa~ to be able to read programs easily. The readability of programs is far more important than the writability . It is vital that the syntax of a programming language should reflect human thought patterns, rather than the more ‘elegant’ but much more obscure patterns of, for example, the lambda calculus. (Tremblay & Sorenson, 1985, pp. 74-75) Ease of acquisition is undoubtedly a factor in the general adoption of all computer languages, but for those designed for use in schools for initial introduction to programming it is doubly important. Hence it would seem that the study of acquisition of natural language should be an important element in the design of computer languages. An obvious reason why it is not is the lack of a solid theory of language acquisition. Pinker (1989, p. 44), notes that “many devices commonly used in grammatical explanation raise major learnability problems.” Yet in total the body of knowledge of how humans acquire language is considerable. There is no doubt as to the difficulty of the underlying problems. Some authors have declared various aspects of language acquisition as paradoxical. Pinker (1989) bases an entire book on the resolution of a single declared paradox. Actually there is no paradox as such: children do acquire language, and do so as routine, hence the questions posed do have answers, whether known or not. Computer language designers who obviously cannot wait for more of the theory to be delineated should keep in mind that the child sees no paradox at all

Psychology of complrter languages

217

in learning to speak and the existence of competing theories does not absolve the educationalist-computer scientist from considering their consequences. A designer of an ab initio computer language should be able to place that language in a particular theory of language acquisition. At the very least the designer should be aware of the implications of their choices.

Teachers cope with different theories of learning all their professional lives. The important thing is not whether any particular theory is ‘correct,’ but the teacher’s ability to teach effectively using that theory. Since there is general agreement in educational circles that a teacher should be aware of the particular theory of Educational Psychology within which they are operating (at any one time), there is no reason to accept a teaching tool (computer language) into which no particular Educational Psychology (learning theory) has gone. TWO VIEWS OF LANGUAGE The remainder of basic language

ACQUISITION

of this paper examines the implications of two divergent views acquisition, the ‘Selectivist’ (or ‘Transformational-Generative

Linguistic,’ or ‘Rationalist’) view, as presented by Chomsky, and the ‘Constructivor ‘Instructionist’) view as represented by ist’ (or ‘Cognitive Psychological,’ Genetic Epistemologist Piaget: Two major classes of answers [to the language acquisition question] have been proposed: a ‘constructivist’ model follows the lines drawn by Piaget, assuming that language is built up constantly from continuous interaction with a wellstructured environment; and the ‘selectivist’ model, typical of what Chomsky is asking for, assumes that language template is pre-organized in the neuronal structure of the human brain, so that the fact of being an integral part of a given environment selects the boarders of each individual neuronal structure, without affecting its fine organization, which pre-exists. (Danchin, 1987, p. 30)

The languages which would develop under these paradigms would differ fundamentally. Piaget talked in terms of fairly generalized innate abilities developing and building specific cognitive structures, among them language. Chomsky presents a view of a very specialized language facility largely independent of, but closely interacting with, other cognitive domains. To Chomsky, it is self-evident that what he terms the ‘language organ’ develops in the same way as the heart or lungs. The underlying, genetically determined structure of this language organ Chomsky terms ‘Universal Grammar’ (UC). THE SELECTIVIST

VIEW

It seems doubtful that there exist general learning strategies of much interest or significance, though of course one must keep an open mind on this. (Chomsky, 1976, p. 214) Chomsky’s work as it has evolved over time has become educationalist, in part because it has developed from

more interesting to the examining “systems of

to systems of principles” (Salkie, 1990, p. 74). His most recent work is “more closely linked to . . . epistemology” (Moore & Carling, 1987). It is his rules

21x

,I.

s.

hlurll;lne

interest in the way children acquire language which makes him interesting to the computer language developer. The grammar of a language determines the formal and semantic properties of that language. Chomsky (1976, p. 29) defines UG as “the system of principles, conditions, and rules that are elements or properties of all human languages by . . biological, not logical, necessity.” He considers the “possibility that by studying language we may discover abstract principles that govern its structure and use, principles that are universal by biological necessity and not mere historical accident, that derive from mental characteristics of the species . Those languages so generated are those which can be ‘learned’ in the normal way” (ibid.). In other words, languages not conforming to UG are not processed by the language organ and must be learned in some other fashion employing different mental facilities. Thus to require a student to learn a non-U<; language is to seriously underutilize an extremely powerful mental tool. UG is the basic biologically determined invariant with which humans construct and understand profound:

languages.

Its significance

for computer

languages

would

be

UC can be taken as expressing the essence of human language. UG will specify what language learning must achieve, if it takes place successfully What is learned, the cognitive structure obtained, must have the properties of. UG, though it will have other properties as well, accidental properties If we were to construct a language violating UG, we would find that it could not be learned by LT(H,L).* That is, it would not be learnable under normal conditions of access and exposure to data. Probably it could be learned by application of other faculties of mind: LT(H,L) does not exhaust the capacities of the human mind. (Chomsky, 1976, p. 29, emphasis added) Non-UC; ‘languages’ are therefore possible, but it is not possible to learn them in the same way as a nutural language. Chomsky advances the thesis that a non-UG language could be learned “as a puzzle” or dealt with using the “science forming” component of human cognition? (ibid.). That is to say it would be processed every child

using a much weaker naturally and easily

mental regime. Chomsky points out that while acquires language, only some learn to think

scientifically. He emphasizes that children naturally acquire the ability to distinguish grammatical from non-grammatical sentences. One of the most obvious activities in programming is in deciding if a ‘sentence’ follows the grammar of a particular computer language. If that language is consistent with UG, this should be a much easier task than if it is not. Kemeny and Kurtz (1967), like FORTRAN or Algol the authors of Basic, point out that “a language requires that the user remember a large number of con-c~entions. This makes it harder to learn the language and occasional users complain that they have to

*Learning Theory (Human, Language)-the theory of how the Organism (Human) learns the Domain (Language). Khomsky’s theory requires scientific ability to develop from more general cognitive structureS. Scientific ability and scientific thought are not produced by an organ as language is.

Psychology of’ computer languages

219

‘relearn’ the language each time’ (p. 8, emphases added). On the other hand, children never have to ‘relearn’ the grammar of their natural language. A language consistent with UG would harness considerable native resources to the task of learning to program: “People just don’t have evidence for the things they know” (Chomsky, quoted in Beckwith & Rispoli, 1986). This implies that children could learn to program with an absolute minimum of help from the teacher-and understanding would be intrinsic. If Chomsky is correct in his analysis, it is a reasonable assumption that all computer languages selected for use in introductory programming courses should conform to UG. Only in this way will the students be able to bring to bear their most powerful mental facility. Young children will not have developed, or fully developed, the necessary scientific cognitive structures to process a language requiring their use. Or they may not be sufficiently interested in ‘puzzles.’ There is the immediate difficulty that almost nothing is known of the form of UG, assuming it exists, and there is considerable controversy over the way in which it processes data to produce a particular language (Kilby, 1987; Smith, 1987). This does not absolve the language designer from considering the implications of UG, and moreover it is quite conceivable that derivation of a language from UG would not be necessary since the actual form of an existing language should provide sufficient examples of syntax to construct a practical computer language conforming to it. A designer convinced of the Selectivist approach would be bound to produce an ab initio computing language as much in line with the natural language of the projected users as possible. This would preclude: Deliberate attempts to design the language to promote ‘new’ ways of thinking. The use of mathematical notation such as lambda calculus or Lisp’s Sexpressions.

The necessity for deeply nested sets of parentheses. The production of disjointed code segments. The introduction of arbitrary syntactic and semantic rules.* For the theoretician, there is the lure that UG, if known to any extent, could be used to automatically generate perfect computer languages. In a sense, implementing UG would implement the ultimate language. And in a form which would undoubtedly directly implement its own translator!? There is an additional, negative consideration: the potential loss of language learning ability over time: “Many theoretical works, grounded on an important quantity of experimental data (fine neuroanatomy), have demonstrated that, parallel with the growth of neuronal tissue, an important regression of connectivity (and even cell number) takes place as learning progresses . . . The rules of syntactic structures are therefore imposed by neuronal structure . . . but

*For instance, the need for parentheses in some Logo statements to differentiate between the minimum number of arguments and more than the minimum number, and the ‘else belonging to the nearest if’ rule in Pascal. tThat is, the translator for the language would be written in its own language. An interpreter would follow immediately just as Lisp interpreters are written in Lisp.

““0

,j.

s.

nrlll~rlalle

this can happen only at a given time in brain some aptitudes are lost for ever” (Danchin, suggests that this loss occurs “around puberty.”

development, a time after which 1987, p. 33). Hurford (1991) Even if a language does conform

to UG, it may not be processable by the language facility if it does not correspond to the parameter settings (typology) already in place. Chomsky bases his theory partly on grammatical linguistics, and partly on a philosophical examination of the nature of communication and meaning, but there are several other empirical straws in the wind which point in the same direction. Recent studies of various speech disorders strongly suggest a genetic basis (Gopnik & Crago, 1991). Programming texts have long taught the importance of writing readable programs, emphasising readability over writability (see above). At the Institute of Education the importance of thinking problems out in English and producing them on paper in this form before ‘translating’ them to a specific computer language has long been stressed-a strategy borne out by over 20 years of empirical testing, and a principle often occurring since in books on non-applicative programming. There is universal agreement that too much nesting in programs is a source of error-in practice natural language is not nested to any great depth and where it is, the sentence is usually very context sensitive.* There is the question of whether UG, if implemented as a computer language, would automatically provide an environment sufficiently structured to promote relatively error free programming. The inherently ambiguous nature of natural language is more semantic than it is syntactic in origin and a grammar addresses only the latter. Many of the problems in current programming languages (where the syntax is highly restricted) are in fact semantic in origin despite the avowedly context-free grammar. The more general the language, the worse these problems become. An English-like language also carries the danger that because one structure works, others which appear similar will be tried although they are not actually part of the language. Further, because particular programming constructs must be given very particular meanings, it is possible for a program author to think the program will perform in a particular fashion and actually do something different. This could be described as the ‘PLl trap’ since it is a failing for which that language was noted. As argued above, a language based entirely on scientific principles is not that required as an introduction to programming, yet ambiguity must be eradicated. Would the existence of a basis of irreducible, syntactically correct grammar conforming to UG automatically ensure a language which would be sufficiently The most ‘English-like’ language

astringent? with which

there

is experience

at the

Institute of Education is HyperTalk, the language associated with the Macintosh HyperCard system. HyperTalk is an odd language. In some respects it closely resembles English. This extends to the trap alluded to above in that it invites constructions on which past experience should work but do not. This can at least partially be attributed to the fact that the syntax was never thought out as a

*Despite the fascination such artificial intelligence fraternity.

largely

artificial

constructions

seem to have with linguists

and the

Psychology

of computer

221

languages

whole, but developed over a number of versions. For instance, “the variable ‘it’ is special in that the commands ask, answer, read, and get automatically put their values into it (and only it) . . . This dates back to the time when ‘it’ was the only variable allowed in HyperTalk” (Winkler 8c Kamins, 1990, p. 97). ‘It’ invariably plays a large part in any HyperTalk program. This is not the way to develop a language with a solid linguistic base, but for the most part, as a Graduate Diploma student reported during a seminar, “I like HyperTalk because you can almost write what you want to say in English.” This quality of being very ‘natural’ makes HyperTalk

about

the most popular

language in use at the Institute, at least among students.* It is very noticeable that they do not encounter a totally insoluble problem in their programming nearly as frequently they do when using Logo (or worse, Logowriter). Problems they have, but they more often manage to find a way around them. This leaves the problem of designing languages conforming to UC from the ground up. While Chomsky considers that the number of derivable grammars will be small, (Chomsky, 1982), h e is able to offer only a fragmented and sketchy account of UG. What is more he “is under no illusion that particular versions of universal grammar currently proposed by him or his co-workers will turn out to been the right track” (Moore & Carling, 1987). Even with the assumption that what little is known is correct does not suggest the language designer will gain much assistance here: “Chomsky has shown us how little we understand those human capacities that are distinctively human” (Hornstein, 1989). But if the Selectivists are correct, this does not allow the language designer to create a language ignoring all linguistic principles simply because not enough is known about the true ones. Computer languages are invariably context free, with the simplest form of non-contracting grammar (Chomsky Type 3), whereas natural languages are contracting and context sensitive (Chomsky Type 0). However, since Type 3 languages are a subset of Type 0, UG still applies to them. “Certainly context free grammars represent some of the properties of languages” (Chomsky, quoted in Huybregts & Riemsdijk, 1982, p. 16). The very fact that the programming language would be Type 3 would of itself eliminate much ambiguity. “The work in computer programming and natural language understanding makes basic use of phrase-structure languages of one sort or another. Transformations are generally avoided since they give rise to wellknown computational complexities which are best avoided” (Carlson, 1989, p. 8). In practice, the aim of anyone in the Selectivist camp should be to create a grammar as close as possible to the student’s native mode of language asfur as it is known. THE CONSTRUCTIVIST

VIEW

“The fundamental hypothesis of genetic epistemology is that there is a parallelism between the progress made in the logical and rational organisa-

*It is, admittedly, hard to separate any attraction HyperTalk may have as a language from other facets of the system which students may find attractive. The quotation from the student above came from a class using predominantly HyperTalk rather than other HyperCard facilities.

‘) ‘j ‘j -c*

,I. tion of knowledge (Piaget, 1970)

If the mental

models

and

s.

Mr11-llarlr

the corresponding

of Jean

Piaget

formative

are taken

psychological

as a basis,

process.

we should

strive

to

develop languages which develop student’s minds. Unlike Chomsky, Piaget held that the underlying mechanisms for developing various cognitive structures including those involved with language are not specific but reasonably general. Further, this development, while proceeding along fairly fixed lines, is none the less heavily influenced by the environment to which the child is exposed and the activities in which they indulge. “One of the most surprising outcomes of Piaget’s research program was the discovery that the earliest function of speech is not communication, but symbolisation . . So in this view language is more of a technique or strategy for structuring thought than a vehicle for communication” (Casti, 1990, p. 241). For Piaget, “syntax is a consequence of meaning organisation” (Danchin, 1987): that is, he does not ascribe to it the heavy syntactical element present in Chomsky’s theory. Without getting into the morass of what ‘meaning’ might or might not be, it can be said that this implies the existence of changing cognitive linguistic structures which are modified (or self modified) over time. Not only does this foreshadow a different approach to teaching compared to the it also implies a very different view of introductory Selectivist position, programming languages, and of the effects of teaching students to program. Cognitive Psychology of the Constructivists implies that learning to program can eff-ect, among other things, language. Taking this view, a computer language used by developing minds should evolve along lines which encourage the student to build and develop appropriate cognitive structures. A carefully designed developmental language is very important since it would be reasonable to assume that the language will at least partially determine the shape of the mental syntactic structures which develop as a result of contact with it. Note that the Sapir-Whorf hypothesis, which states in part that language determines the way we think, does not assume that there is a UC to which that language must conform. In fact Carroll (1956, p. 27) puts forward the (tentative) suggestion that “all one’s life one has been tricked, all unaware, by the structure of language into a certain way of perceiving reality, with the implication that awareness of this trickery will enable you to see the world with fresh insight.” If this is true then the emphasis on, for instance, recursion and predicate calculus in Logo is important and valid. It must be said that Piaget himself “felt that language makes only a small contribution to thought” (Casti, 1990, p. 528). The details, and even the broad outline, of Piaget’s original ‘stages of learning’ have been challenged, but the concept of progression from the concrete to the formal operational stage still remains as a foundation of Genetic Epistemology. The area of learning is relatively unimportant here, since Piaget considered all mental structures to be quite general: if there were stages in one area there were stages in all areas. Hence children learning to program should begin with the concrete and the language should virtually dictate this. The Logo Turtle (among

Psychology of computer languages

223

‘objects’) has amply justified itself in this role. Yet other computer-driven Papert’s assertion that “the turtle is vastly more important than Logo” (Papert, 1988) does not mean the language is then unimportant, since in a sense, the language Zsthe turtle. The first (Turtleless) version of Logo, derived from Lisp, was used to teach logic programming and was generally not successful. It was with the advent of the turtle that the language became accessible to students in the early stages of learning to program. This leads to the question of whether students learning programming pass through a series of developmental stages paralleling other generalized developmental stages. This is an important question for the linguistics of programming and there is some evidence that they do so. If students are instructed to ‘draw a house’ using a computerized tool new to them, it is quite noticeable that they almost always draw a square surmounted by a triangle-the same drawing typically produced by kindergarten children learning to draw and paint. Similar behavior can be seen in other art work. The hypothesis is that a new mode of expression causes students to revert to older more primitive behavior and familiar (compressed) developmental cycles can be observed.* Stuart and Coltheart (1988), among others, cast doubt on stages of language acquisition, at least as far as reading goes: “Ifthere is a sequence of steps in learning to read, not all children pass through them in the same sequence.” However Chipman (1985) reports on research which strongly suggests that there are stages, at least in the strateees children use to understand sentences as they grow older. Research into the linguistic side of students’ development as programmers is badly needed. One of the factors inherent in Logo is the idea that not only does the development of natural language contain a large constructive element, but that the resultant cognitive structures show considerable change over time. This is not to say that the ideas behind Logo and current psychological ideas are always in agreement. Papert (1983) talks of children’s abilities with Logo expanding and changing “like baby talk getting into English.” There is considerable doubt adult language does emerge from baby talk in the way Papert suggests, even within the Constructivist model. Marshall (1987) considers that simplified input has no effect on language acquisition. “Most attempts to predict the child’s rate of language acquisition from the properties of different maternal speech styles have failed. . . .” Nevertheless, most ideas present in the educational psychology behind Logo are consistent with a Constructivist Psychology. The syntax of a language designed under this philosophy would not be dominated by its relation to the acquisition of natural language. Rather it would be dictated by the desire to promote the development of cognitive structures which would not be expected to otherwise appear, or not appear in as strong and useful a form. These would then be expected to pass into, or at least strongly effect, the *This effect is the object of a current study of 400 undergraduate and postgraduate students at the Institute of Education. There is no question of what happens when students are asked to use Logo to draw a house or boat for the first time, the interesting question is the reasons the drawings all look alike.

“24

,J.

s.

hlur~rl;tIlr

formulation

of other cognitive structures: “Already at the pre-high school level, programming is taught primarily because of its assumed impacts on higher cognitive skills, not because proficiency in programming is itself an educational goal” (Pea 8c Kurland, 1984, p. 138). Constructivism leaves far more scope for the transfer of training of skills and concepts developed in computing to other areas than does the Selectivist view. Certainly the ‘transfer of training’ question has bedevilled educational psychologists for many years. There has been very little evidence accumulated that it in fact occurs, and where it does, the transfer is usually tenuous and weak. But this lack of hard evidence is reminiscent of the language acquisition question: unless we postulate that every separately identifiable area of human activity is the result of a largely separate cognitive structure, then transfer must occur in a wide range of activities even though it is difficult to detect and quantify. There is some empirical evidence that skills in computing (notably algorithm development and programming) do have some transfer to other tasks, but the experimental evidence of the transfer appears weak and rather ephemeral. It is noticeable that a number of authors of books on programming in Logo place emphasis on the way the language will develop problem solving skills in general, and skills such as the ability to develop recursive algorithms in particular. The emphasis here is on thinking in Logo. Papert (1980) constantly points to Logo as an “object to think with.” Piagetian Educational Philosophy emphasizes discovery. “If [according to Piaget] progress is to occur, the child must discover for himself the inconsistencies between his beliefs and the results of his behavior (Brainerd, 197X). In discovering facts and relationships students build new cognitive structures and alter existing ones. The task of the Piagetian computer scientist of constructing a language which will foster spontaneous cognitive development is not easy. Certainly Logo has failed to live up to the early claims of its authors in this respect. A language constructed along Piagetian lines must be designed to foster language development aside from natural language, promote new ways of thinking about problems and extend to as many new areas as possible to enhance transfer

of training. SEI.E(;?‘IVISM

OK C:ONS’I‘KUC’I‘I~~ISM?

Brooks (1983, p. 544) describes programming as “the process . . of problem domain, possibly through several constructing mappings from a intermediate domains, into the programming domain.” Computer Scientists following Piaget or Chomsky would differ not only on the form of specification of the problem domain, but on the intermediate domains. For the Selectivist, the question is whether any or all of these domains are specified in a manner that conforms to UC. If not, translation through (perhaps several) non-UC domains to a (probably) non-UC computer language follows. Yet to the extent thought about transformations is language-based, it will be in a natural language. Hence these translation steps suggest a technical, rather disjointed process. Possibly none of these dornains will allow the full

Psychology of‘ computer languages

225

power of the language organ to be brought to bear on the problem. If the domains are specified in a manner conforming to UG, the solution will be smoother, and the full power of the language organ can be brought to bear. The Piagetian position is much simpler, since there is no need to differentiate between the power of different cognitive structures. Ideally the language of the computer should as far as possible be the language of the problem domain. This is usually the aim of most language designers and produces the greatest benefit in terms of the formation or refinement/expansion of conceptual domains, and the greatest degree of training transfer. There are some questions which arise here. To what extent is the ‘programming domain’ typically coincident with natural language in either or both paradigms? What is the best way to specify the initial problem? Is it to be in UGcompatible form and what of the formulation of its solution? If there are intermediate domains are they subsets of natural language? Weinberg (197 I) considers that a particularly important attribute of programming languages is their “ability to express something that has never been expressed before.” This accords with the Constructivists but not the Selectivists. Does this assume all ‘languages’ are logically equivalent (Constructivist view)-or does it mean that computer languages do not and should not accord with UG? (Selectivist position). The choice between these schools is beyond the scope of this paper. Indeed, there is no reason to believe either is correct in anything like its entirety: many other paradigms are possible. Casti (1990, p. 260) offers a view combining Chomsky’s ideas of modularity and innateness with a hierarchical grammar. Pinker and Bloom (1990) offer a detailed evolutionary basis for language. Many educational psychologists (Brainerd, 1978) cast doubt on the strength of the innate systems both Chomsky and Piaget assume to exist. The Connectivist approach offers yet another possibility. (For a full debate between the protagonists themselves see Piattelli-Palmarini, 1980.) Nevertheless, these schools, being at opposite ends of the innatest spectrum, do present the would-be language designer to a fundamental choice: to present the student programmer with a language which will immediately utilize their linguistic ability in a full and direct manner, or to present them with an environment within which their cognitive linguistic-problem-solving facilities can further develop. The choice depends on the designer’s belief-disbelief in the student’s ability to utilize language to develop language, as well as other areas of cognition. This leaves aside the whole area of the most efficient way to actually teach children once this decision is taken. Piaget emphasized the necessity for the child to be actively involved for any significant cognitive structures to form. Chomsky and Piaget differ in consideration of how we acquire language and in consequence, how education should approach language acquisition. Chomsky considers it a waste of time to speculate on how (UC) language might be taught. “Language is not really taught, for the most part. Rather it is learned, by mere exposure to data . . . nor is there any reason to suppose that people are taught the meaning of words” (Chomsky, 1976, p. 161). Unfortunately this principle,

226

,I.

s.

Mu1-rlxle

where the dichotomy between the theories seems so profound, can not be used as a litmus test to decide between them. Both predict that computer languages can only be acquired ‘by exposure’ although for very different reasons. Piaget demands experience in order to build the necessary cognitive structures: Chomsky to provide data for the language organ. Note that despite repeated attempts with Logo to substantiate claims that contact with the language will lead to learning, the evidence limited in scope.

is that any progress

due

to experience

alone

is very

A related problem is the question of data, and at a higher level knowledge, representation. The approach used in Prolog where data and algorithm are not differentiated characterized programmers.

but constitute, at differing times, integral parts of a single process, above as very astringent, was suggested as too abstract for trio UC deals with syntax, not data structures as understood in the

context of Computer Science. In fact it would appear that the idea of separating data and algorithm is not supported by UC and the Prolog approach is far closer to it than the ‘data structure + algorithm’ ethos of algorithmic languages. Hence the view held by supporters of Prolog as an introductory computing language that the data representation used in the language is very natural and easy way to express ideas. For the many teachers who declare that it is not, what structure is to be considered ‘natural’? UC deals with syntax: does the mind build a set of corresponding data types or does UC imply all data (knowledge?) is embedded in language? If so, is it structured in predicates or even S-expressions? Does the conscious mind manipulate data in the form of predicates? Or do humans (unconsciously) ‘see’ the data as separate to the algorithm? for instance, a Pascal RECORD description internalize and function context of UC? Of course it fits very well with the Constructivist These ‘directed

questions, activities,’

while perhaps do impinge

How does, within the approach.

not resolvable in the context of grammar heavily on programming courses and

or on

professional programming. It is noticeable that in ‘second’ programming courses at the Institute, where data structures assume considerable prominence in their own right, some students encounter problems directly related to the conceptualization of data. This appears to be a rather ‘all or nothing’ thing in that a student either has an obvious problem or they do not have one at all. Along with the basic data representations deserve educational philosophy of language acquisition, attention.

PRINCIPLES

FOR PROGRAMMING

LANGUAGES

Without deciding which view of language acquisition to favour the derivation of any set of principles for the formulation of programming languages must necessarily be very general. Some tentative principles can be stated however: Humans do develop large concept areas and these have significant linguistic components. Programming is a subset of human behaviour with its own identifiable set of behavioural and cognitive skills. Language does play a large role in the formulation of ‘programming’

of‘ computer

Psyclwlogy

227

languages

problems in all domains. It also plays a large part in translation between domains. The earlier in a programmer’s education a language is designed to be

used, the more closely it should follow an identifiable educational philosophy. There is a basic (as yet unspecified) grammar to which introductory programming languages should conform. (Selectivist view) Programming languages should be designed cognitive development.

to promote

linguistic

(Constructivist

view)

CONCLUSION Computer language creators discipline cannot be studied in In particular, the relationship deserves far more prominence of those designed for ab in&o language consider language

have too long ignored the principle that a isolation from the way that discipline is learned. of computing languages with natural language than it currently receives, particularly in the case courses. Even the originators of Logo, the only

to date designed with a significant linguistics. Even without the assurance acquisition will eventually dominate,

constructed educational

psychological input, did not that any particular theory of such languages should be

with a definite view of language acquisition in mind. This view of philosophy should appear implicitly and explicitly in the language. REFERENCES

Beckwith, R., & Rispoli, M. (1986). Aspects of mind: an interview with Noam Chomsky. New Ideas in Psychology, 4, 187-202. Beth, E. W., & Piaget, J. (1966). Mathematical epistemology and psychology.Dordrecht, The Netherlands: D. Reidel. Brainerd, C. J. (1978). Learning research and Piagetian theory. In L. S. Seigel, & C. J. Brainerd (Eds.), Alternatives to Piaget. New York: Academic Press. Brooks, R. E. (1983). Towards a theory of comprehension of computer programs. International

Journal

of Man-Machine

Studies,

18, 543-554.

Casti, J. L. (1990). Paradigms lost. Stafford, U.K.: Scribners. Carlson, G. N. (Ed.). (1989). Linguistic structure of language processing. Dordrecht, The Netherlands: Kluwer. Carroll, J. B. (1956). Language, thought and reality. Selected writings of Benjamin Lee Wharf. Cambridge, MA: MIT Press. Chipman, H. (1985). Aspects of language acquisition. In V. Shulman, L. RestainoBaumann, & L. Butler (Eds.), The future of Piugetiun theory: The Neo-Piagetians. New York: Plenum Press. Chomsky, N. (1976). Refictions on language. London, U.K.: Temple Smith. Chomsky, N. (1982). Lectures on gouernment and binding (2nd ed.). Dordrecht, The Netherlands: Foris. Danchin, A. (1987). Biological foundations of language: A comment on Noam Chomsky’s approach of syntactic structures. In S. Modgil, & C. Modgil (Eds.), Noam Chomsky: Consensus and controversy. Falmer, U.K.: Falmer Press. Dummett, M. (1989). Language and communication. In A. George (Ed.), Reflections on Chomsky. Oxford, U.K.: Basil Blackwell.

“28

J.

s.

Murnanr

Gannon, J. D. (1975). Language design to enhance programming reliability (Report CSRG-47). Toronto, , Canada: Computer Systems Research Group, University of Toronto. Gopnik, M., & Crago, M. B. (1991). Familial aggregation of a developmental language disorder. Cognition, 39, l-50. Henno, J. (1988). User-friendly syntax: design and presentation. ZnternationalJonrnal of Man-Machine Studies, 28, 55 l-572. Hornstein, N. (1989). Meaning and the method: The problem of semantics after Chomsky. In A. George (Ed.), Reflections on Chomsky. Oxford, U.K.: Basil Blackwell. Hurford, J. R. (1991). The evolution of the critical period for language acquisition. Cognition, 40, 159-20 1. Huybregts, R., 8c Riemsdijk, H. (1982). Noam Chomsky on the generutk~r enterprise. Dordrecht, The Netherlands: Foris. Kemeny, J., & Kurtz, T. (1967). The Dartmouth time-sharingsystem. Final report. Washington, DC: National Science Foundation. Kilby, D. (1987). Typology and universals in Chomsky’s theory of grammar. In S. Modgil, & C. Modgil (Eds.), Noam Chomskyy: Consensus and controver.sy. Falmer, U.K.: Falmer Press. MacLennan, B. J. (1983). Principles of programming languages. New York: Holt, Rinehart 8c Winston. Marshall, J. C. (1987). Language learning, language acquisition, or language growth. In S. Modgil, & C. Modgil (Eds.), Noam Chomsky: Consensus and controversy. Falmer, U.K.: Falmer Press. Moore, T., & Carling, C. (1987). Chomsky: Consensus and controversy-introduction. In S. Modgil, & C. Modgil (Eds.), Noam Chomsky: Consensus and controversy. Falmer, U.K.: Falmer Press. Piattelli-Palmarini M. (Ed.). (1980). Language and teaming; The debate between Jean Piaget and Noam Chomsky. London, U.K.: Routledge & Kegan Paul. Papert, S. (1980). Mindstorms: Children, computers, and powerful ideas. New York: Basic Books. Papert, S. (1983). Talking turtle. [Video recording]. Open University Educational Enterprises, Milton Keynes, U.K.: Holt-Saunders. Papert, S. (1988). The conservation of Piaget. In G. Forman, & P. B. Pufall (Eds.), Constructivism in the computer age. Hillsdale, NJ: Lawrence Erlbaum Associates. Pea, R. D., & Kurland, D. M. (1984). On the cognitive effects of learning computer programming. New Ideas in Psychology, 2, 127-168. Pennington, N. (1987). Stimulus structures of mental representations in expert comprehension of computer programs. Cognitive Psychology, 19, 295-34 1. Piaget, J. (1970). Genetic epistemology. New York: Columbia University Press. Pinker, S. (1989). Learnability and iognition. Cambridge, MA: MIT Press. Pinker, S., & Bloom, P. (1990). Natural language and natural selection. Behavioral and Brain Sciences, 13, 707-784. Salkie, R. (1990). The Chomsky update: Linguistics andpolitics. London, U.K.: Unwin Hyman. Sampson, G. (1980). Schools of linguistics. London, U.K.: Hutchinson. Sime, M. E., Green, T. G. R., & Guest, D.J. (1975). Psychological evaluation of two conditional constructions used in computer languages. International Journal of MunMachine Studies, 5, 105-115. Smith, N. (1987). Universals and typography. In S. Modgil, 1L C. Modgil (Eds.), Noam Chornsky: Consensus and controversy. Falmer, U.K.: Falmer Press. Stuart, M., & Coltheart, M. (1988). Does reading develop in a series of stages? Cognition, 30, 139-181. Tremblay, G. P., & Sorenson, P. G. (1985). The theory and practice of compiler writing. New York: McGraw-Hill. Weinberg, G. (197 I). The psychology of computer programming. New York: Van Nostrand. Winkler, D., & Kamins, S. (1990). HyperTalk 2.0 The Book. New York: Bantam.