Fortran and the first course in computer science
Authors: Ralston Anthony 
Published: July 2004

The purpose of this paper is to assess realistically and practically the merits and demerits of Fortran as the language to be used in a first course in computer science. To do this computer science education is first considered as a process in which successive courses should aim at increasingly greater depth of understanding as in, for example, mathematics education. Then the aims of first courses in computer science are considered. It is concluded that Fortran is a quite adequate vehicle for the student to use in writing programs. It is further concluded that, despite its manifest imperfections, Fortran is also adequate for the purpose of teaching programming language concepts and programming techniques. Thus, it is finally concluded that, since Fortran will continue to be with us, it can be used, warts and all, and that the best should be made of it.

Even if a weed, Fortran has surely not prevented the blooming of more than one hundred other flowers (i.e. computer languages). But, in terms of ubiquity, these other flowers almost all are puny growths indeed. Except for Cobol, Fortran is clearly the most used higher level language today. And it stands preeminent as the language most often taught in college and university first courses in computer science and "for 'scientific' problems...it will probably remain (the most important programming language) for some period of time" (3). Yet we have such statements as "Fortran is dead" (6) and "It is remarkable that it would be difficult to find a language that would meet these important requirements (natural and clear expression of program structure and data, exhibition of basic features and structuring principles) to a lesser degree than...Fortran" (8). My purpose here is neither to bury Fortran nor to praise it but to try to assess realistically and practically its usefulness in a first course in computer science.

I was originally moved to write this article by the recent article of Wirth (8) which I consider to be a beautiful exposition of an ideal in program construction and instruction. But, while I do not disagree, except perhaps in emphasis, with the quotation above from this article, I think this quotation, if taken literally, implies something quite wrong about the value of Fortran in a first course in computer science by implying something pedagogically incorrect about teaching programming. I shall try to elucidate this below.

Yes, Fortran is dead in the sense that Rosin (6)means, namely that "intellectually it is dead." But in this sense so is calculus dead in all of the wide variety of courses taught to college freshmen and high school seniors. So what? The purpose of first courses in calculus is not and cannot be to teach students material on the intellectual frontier of mathematics. Can it be said of calculus, any more than of Fortran, that its current use in an introductory course "tends to propagate its intellectual moribundity" (6)? The trouble with such negative remarks about the use of Fortran in introductory programming courses is not that they are too critical of Fortran but rather that they display a misunderstanding of the teaching of almost any subject with some intellectual depth by postulating a pedagogic ideal which can be attained with few, if any students.

It is natural when teaching any introductory course to wish to maximize the intellectual content of the course by presenting, in addition to material on purely mechanical skills, subject matter of real intellectual content. But it is folly to expect the beginning student to grasp significant concepts in depth. (Or, if this is possible, then the depth is not very great; if this is the case in computer science, then perhaps we should rethink our pretensions that it is a discipline.) For example, it is not expected that the graduate of a first year course in calculus will understand what a derivative is in depth although he may be very proficient in mechanical differentiation. I recall myself only realizing, after taking courses in advanced calculus and real analysis, how little I had really understood the concept of derivative when I had first studied it in an introductory course.

It is in a similar context that we must look at the teaching of programming. The objectives of a first course in computer science must be to teach the student some conceptual aspects of programming, programming languages and computer science in addition to teaching him how to use a particular language. But unless and until we are willing to admit that there are programming language concepts which, while they may be
introduced
in a first course, cannot be expected to be
understood
in depth by the vast majority of students until later, more advanced courses, there is danger that attempts will be made to make the first course something it cannot and should not be. And we shall run the danger of falling into the same trap as other disciplines of orienting our teaching so much to our own majors that we shall ill serve the majority who are non-majors, with the inevitable result that an increasing number of non-computer science departments will decide to teach (badly) programming to their own majors.

Of course, the current problem with most introductory courses in computer science is not that they attempt too much but rather too little. But an increasing number of first courses, particularly at leading universities, are attempting to teach the first course at a reasonable intellectual level.

It is, therefore, just at this time during the transition from the just-teach-a-language course to a real computer science course that it is important to give some real thought to what that first course should be and the place of a language like Fortran in it. In the remainder of this paper I shall address this question.