Here are some of the most widely used and influential programming l...
### Sapir-Whorf hypothesis The Sapir-Whorf hypothesis suggests tha...
### BASIC In the early 1980s, BASIC was the dominant language on p...
In FORTRAN, especially in older versions of the language, you canno...
Early versions of BASIC, especially those used in microcomputers in...
### APL APL (A Programming Language) is a high-level programming l...
SOFTWARE-PRACTICE
AND
EXPERIENCE,
VOL.
11,
733-740
(1981)
The Consequences
of
One’s First Programming
Language
RICHARD L. WEXELBLAT
Sperry
Univac,
Blue Bell,
PA
19424,
U.S.A.
SUMMARY
After seeing many programs written in one language, but with the style and structure of
another,
I
conducted an informal survey to determine whether this phenomenon was
widespread and to determine how much a programmer’s first programming language might
be responsible.
This paper discusses my observations, gives informal results
of
the survey and suggests the
need for a more formal study.
KEY
WORDS
Programming languages Teaching programming Education
BACKGROUND
What experienced programmer has not seen programs written in one language that
have the style of another language? Having experienced ‘FORTRAN with semicolons’
and ‘C with
a
BASIC flavour’ over the years, I began to wonder whether the
programmer’s first programming language had an effect on programming ability as
profound as the effect of one’s native language on one’s thought patterns.
Referring to what has been called the Sapir-Whorf Hypothesis, the logician W.
V.
0.
Quine has said ‘One frequently hears it urged that deep differences of language carry
with them ultimate differences in the way one thinks, or looks upon the world’.’ Dwight
Bolinger characterizes the hypothesis:
Since every language has a form and no two forms are the same, it follows that
no two cultures having different languages can have identical views
of
the
world. Instead
of
a perfectly flexible rubber mask that shapes itself to reality,
each language is somewhat like
a
Greek mask with its built-in scowl or grin.2
Over many years
of
programming, teaching programming, and debugging other
people’s programs, it has seemed to me that something akin to the Sapir-Whorf
Hypothesis applies to programmers-especially to those who have never been taught to
abstract the development of algorithms from the development of programs. Indeed, I
began to worry about the consequences of loosing on the computer centres and
computer science departments of the world a horde of programmers whose total
background is a rudimenatry BASIC learned in elementary or high school from a
teacher who has virtually no actual programming experience.
Kathy Hirsh-Pasek, who read an earlier version of this paper commented that I
I.
. .
should realize that the Whorfian hypothesis has both
a
strong version, “language
003 8-0644/81/07073 3-08$01
.OO
@
1981
by John Wiley
&
Sons, Ltd.
Received 14
August
1980
Revised
3
November 1980
734
R.
L.
WEXELBLAT
determines thought”, and a weak version, “language influences thought”: The strong
version which is depicted by this quote (i.e. Bolinger), is almost always contested. The
weaker version is virtually tautological’. My feeling is somewhere in between.
Of course, there are many fine teachers of programming at the pre-college level-and
my rude remarks also apply to some who teach programming outside of the high
schools and elementary schools. I see two interrelated problems: the teaching of the
programming language
and the teaching of
programmingper se.
Although there are some
who can ably and successfully teach the former, there are lamentably few who can teach
the latter. It is the effect of poor teaching and limited languages on the malleable minds
of youth that concerns me here.
If the language does even influence our way of thinking about programming then
it
is
quite important that we teach the concepts of programming before we teach the
language. Otherwise the biases will become ingrained.
In
1978
I published
a
request provocatively entitled ‘Youthful indiscretions, or is
BASIC bad for your health?’ in
a
series of journals, asking for information on
experiences that might confirm
or
deny my hypothesis. (The text of the letter is
appended below).
I
received almost
50
replies broken down roughly as:
30
addressing my points
12
not relevant
4
pointers to other sources
2
attacking me for raising the issue in the first place.
SUMMARY OF FINDINGS
There seems to have been no serious attempt at a controlled statistical study of the later
effects of the first programming language. Indeed, the problems of designing such an
experiment would require a major commitment of time and resources and a very large
population of students studied for years. I have come to this conclusion after thinking
about the enormous number of independent variables and their cross-correlations. For
any observed aspect of programming behaviour, there seem to be dozens of equally
valid alternative explanations. Without access to a large sample of students learning the
same language on the same operating system from the same teacher, etc., there seems
no way to isolate cause and effect from noise and artifact. Hirsh-Pasek adds that this is
why psychology and education are separate disciplines. ‘You can’t do pure research and
control variables in the classroom. Even if teacher, book and socioeconomic status are
controlled, individual and other differences wash out results’.
With the understanding that no universal truths are implied, here are some highly
subjective conclusions. There is no hard evidence to support or to deny any of these
opinions.
0
Programmers tend to favour their first language even to the extent of applying the
style or structures
of
this language when they program in other languages.
This tendency may be reduced by many other factors such as the length of time
the first language was used exclusively, the skill with which the second language
was taught, and the innate ability of the programmer.
ONE’S
FIRST
PROGRAMMING
LANGUAGE
73
5
0
Those who begin with an assembly language often have an unfortunate tendency
to prefer assembly language. Otherwise there seems to be no long-term effect on
the ability to assimilate new high level languages.
I believe this to be due to the very low level of most assembly languages. The
programmer is forced to abstract the conceptualization of the problem from the
coding of the solution.
0
The effects of poor teaching of programming methodology are probably as
important as the effects of
a
poor first language. Although (I repeat) there is no
significant quantitative evidence for this point of view, many programmers,
teachers, and managers of programmers have independently come to this
conclusion.
The usual result of linguistic myopia
(or
poor training) is the inability to abstrqct data
and control structures, the inability to separate the problem solving from the solution
implementation. In current jargon, the problem relates to the differentiation between
procedural
and
functional abstraction. A common manifestation is the tendency to
go
directly from problem statement to code without any intervening design steps. When
a
problem is too big to code directly, the programmer may try to cut off small chunks and
code them in the hope that ‘getting something running’ will eventually lead to a
solution. Such a
modus
operandi
is typical of the bottom-up design methodology that is,
I hope, discredited as an overall design strategy.
Programmers who think of code in concrete rather than abstract terms limit
themselves to the style of data and control structures of their ingrained programming
habits. A FORTRAN programmer who has successfully designed a payroll system
may not see any value in the ability to combine numeric and alphabetic information into
a single data structure. BASIC programmers often find no use
at
all
for subroutine
formal parameters and local variables.
The mind-set problem, works both ways: the PASCAL programmer who is forced to
use FORTRAN or BASIC may end up writing awful programs because of the difficulty
in switching from high-level to low-level constructs. APL converts seem to abhor
all
other languages.
TABULATION OF RESPONSES
My initial query was too loosely worded. After looking at the responses, I tried to
formulate a series
of
statements and then to tabulate (or in some cases deduce)
agreement or disagreement.
0.
The first language does indeed affect later programming ability.
Yes:
12,
no:
5
(Most of the yesses are from people observing other people; the
noes,
all
from people describing themselves.)
1.
Those who start with a limited language may find it hard to make full use of higher
level languages later on.
Yes:
7,
no:
7,
maybe:
2
Yes:
5
Yes:
9,
no:
1
2.
BASIC is a limited language.
3.
A small language is
a
good first language.
736
R.
L.
WEXELBLAT
4.
For beginners, the distinction between writing a program, translating it and
executing it is missing.
Yes:
2,
yes (but good):
3
Yes:
3
PASCAL:
5
PL/C (or similar):
5
Algol:
2
PL/I:
2
Assembler:
2
FORTRAN:
1
APL:
1
Structured pseudo-code:
2
COBOL:
7
FORTRAN:
3
PL/I:
3
Assembler:
2
BASIC:
2
Algol:
2
APL:
1
SNOBOL:
1
PASCAL:
2
LISP, Assembler, Algol, APL:
1
each
APL, BASIC, COBOL:
1
each
5.
The programming process is not learned when a limited language is used first.
6.
Good first languages are:
7.
Bad first languages are:
8.
Good later languages are:
9.
Bad later languages are:
Obviously, not all respondents addressed all of the above items. I was interested to
note that the majority
(5
of
7)
answering no to item
1
themselves began programming
in machine or assembly language.
Some of the respondents’ comments are interesting:
0
Prior experience with FORTRAN and PASCAL interfered with learning LISP.
0
Learning a ‘strange’first language (APL, SNOBOL, LISP) may limit later ability
0
Assembly language programmers are overly concerned with efficiency.
0
COBOL programmers have no insight into programming. (This, from someone
who professed to be a long-time COBOL programmer who had begun program-
ming in assembly language).
0
Managers who know only BASIC cannot understand the need for software
engineering.
0
An advantage to learning BASIC first
is
that you can avoid the need to worry about
data structures.
to program in a ‘classical’ language.
One respondent was a student about to take her first programming course. She was
concerned that learning BASIC would harm her ability to program. (I encouraged her