1. Introduction

Not too long ago, most computer science departments used Pascal as their introductory language. In recent years, however, we've seen a wide divergence, as many departments switched to C, C++, Ada, Scheme, and other languages.

Richard J. Reid of Michigan State University maintains a list of languages used in CS1 courses [11]. This list is updated semiannually; the latest version confirms that there is no longer a single dominant language. Instead, six languages each have a share of 10% to 30% of the market (Table 1). At least a dozen other languages are used as well, but none has more than a 2% share. Although there's no guarantee that the schools in the survey are representative of the thousands of colleges that teach introductory programming, this survey provides the best information currently available.

Table 1: Language Usage in CS1
Language Number of
Colleges
Percentage
of Total
Pascal, Object Pascal 153 30.1
C++ 87 17.1
Ada 74 14.6
C 51 10.0
Scheme 51 10.0
Modula-2, Modula-3 49 9.6
Others 43 8.5
Source: Richard J. Reid, CS1 Language List, 15th
edition (October 15, 1996)

The lack of consensus concerning the introductory language has caused a variety of problems [3]. One set of problems affects computer science departments. Failing to agree on which language to switch to can cause paralysis and stagnation. A switch that's not widely supported can result in friction between colleagues, in extreme cases even causing highly qualified faculty to depart rather than teach a language that they personally abhor. A profusion of languages also makes it harder for departments to find qualified instructors and teaching assistants.

A plethora of introductory languages can also hurt students by making it difficult for them to transfer courses from one college to another or to get advanced placement credit. Imagine the difficulties faced by a student with a Scheme background, say, transferring to a school where C++ is the language of choice.

Another problem is fragmentation of the textbook market. When multiple languages are used in the introductory course, books designed to teach one language are often hurriedly translated to other languages, with mixed results. Some of the best books are available only for a single language, making them unusable by instructors teaching other languages.

Java, the new language from Sun Microsystems, could well be the solution to these problems. Java is a general-purpose, object-oriented language that's been in the news quite a bit over the past couple of years. Most of Java's press coverage emphasizes its client/server role, as a language for writing ``applets'' that are downloaded from a server and executed locally. But Java isn't restricted to writing applets; it works just as well for writing traditional single-computer applications.

This paper examines the advantages and disadvantages of Java as a teaching language, with the focus on using Java as the first language that students encounter at the college level. It pays particular attention to how Java stacks up against C++, the language whose use in academia is growing the fastest. In Reid's Spring 1995 survey, only 27 schools reported using C++ in CS1; in the latest survey, the total stands at 87. (The growth of C++ may have peaked, however; the number of schools reported to be using C++ increased by just five between April 1996 and October 1996.)

The perils of teaching C++ are well-known. There is widespread agreement among faculty that C++ needs to be prominent in the curriculum because of its widespread use in industry, but there is considerable doubt that C++ is a suitable introductory language. As Kölling and Rosenberg [7] put it, ``We agree that a graduate must be a competent programmer in C++ or a similar widely used language. It is our firm belief, however, that experience with one year of a good teaching language and one year of C++ produces better C++ programmers than two years of C++.'' That paper argued for the creation of a new language for teaching object-oriented programming. Another paper [3] proposed several ways to attack the problem of choosing a first language. One proposed solution was to design a new language ``with a C-like syntax, but without the problematic features of C.'' This paper will argue that no new language is needed--Java fills the bill.

Next section


Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.

© 1997 ACM