[Mostly written winter 1996, and not updated lately.]
We in the Computer Science Department at the State University of New York at Oswego have been using Java in the freshman CS majors-oriented introductory programming course (``CS1'') since September 1995, and in the second (freshman/sophomore) programming course (``CS2'') since January 1996.
Lately, many people from other Computer Science departments have been asking me how it is going. I never quite know what to say beyond ``so far, so good''. Instead, I'm collecting some particular questions and answers here. I'll update and add items as I get the chance.
First, here is some quick background: These are 13-week semester-long 3-credit lecture courses with programming labs. The CS1 (and some CS2) labs include structured, supervised exercises. Craig Graci is teaching CS1. I'm teaching CS2 this semester to students who (with a few exceptions) learned Java in CS1. We've also used Java in a few other CS courses, and many of our junior/senior students are choosing to use Java for projects in advanced courses. But CS1 and CS2 (and to some extent CS3 and related courses) represent our main current efforts in evolving our mostly ACM-style undergraduate-only BA/BS Computer Science program with a general emphasis on systems and software engineering. CS1 and CS2 are also taken by Information Science majors, CS minors, some math and science majors, and other interested students. Besides the CS1/2/3 prgramming-based sequence, we also require majors to take courses in (1) computer architecture and low-level programming, (2) an introduction to formal methods, (3) a comparative programming languages course where students learn non-Java-like languages like ML and their associated programming paradigms, (4) an introduction to software engineering based around Watts Humphrey's PSP (that was taught most recently using Java). Before using Java in CS1/2/3, we used (most recent first order) C++, Modula2, Pascal, and Fortran for core courses. We standardize on languages only for the CS1/2/3 sequence. Beyond there, instructors require or suggest using any language that makes sense for their courses, or just leave it up to the students. We do not yet use Java in any way in any of our ``service'' courses for non-majors.
I really cannot think of any good pedagogical reason not to. Some obvious advantages are:
There are of course some differing opinions out there. It's not hard to find articles, web pages, and mail saying that Java should have been more like Ada or Eiffel or Smalltalk or ML or ... probably even Cobol.
We don't think so. We don't for example bother to teach Visual Basic, even though it is probably the most widely used programming language in the world.
But Java is different. Java supports a minimal set of constructs that together reflect the bulk of technical advances in programming methodology that have occurred over the past fifteen years or so. Its status is analogous in many ways to that of both Pascal and Unix in the early 1970s. Pascal, Unix, and Java all arose as simpler, more understandable, and more practical alternatives to existing technologies (Algol68 etc, Multics etc., and C++ etc respectively). Further, each contributed new ideas, and ultimately served as the technical substrate for further theoretical and technical advances.
Thus, it is not so much Java language itself, but the programming concepts and skills that are inseparable from the language that affect CS curricula. (In this sense, the fact that Java is relatively easy to learn, and that it is becoming immensely popular in commercial and other everyday use are mainly just added incentives to rethink curricula.) These include:
.class
'' files) that can be found over the entire
internet.
One commonality across these notions is that ``ordinary'' programming increasingly relies on design and engineering principles in addition to those surrounding algorithmics and computation. The need to understand classic data structures, algorithms, formalisms, and analytic techniques has not at all disappeared. However, such topics cannot be studied in isolation, or to the exclusion of others. Perhaps it was once true that implementing a good data structure was tantamount to implementing a useful program. However, as the application, scale, and pervasiveness of software have grown, so too has the need to encapsulate, structure, and coordinate such implementations as components of larger systems.
In short, we believe that it would be a disservice NOT to provide courses introducing, as early as reasonable, concepts and skills that happen to be well supported in Java. The introduction of Java provides a timely vehicle for re-examining these aspects of standard ACM-like CS curricula.
We haven't found this to be a big problem; just a minor nuisance. (To quote Jim Waldo quoting someone else: The language just isn't all that hard!) We don't currently use a text at all in CS1. In CS2, I use a language-independent data structures text mainly just as a reference, without coordinating too tightly with lectures. As of this writing, none of the books out on Java that I have seen (which is by no means all of them) can be recommended as course texts. However, books such as Arnold and Gosling's The Java Programming Language can serve as useful auxiliary texts.
No for CS1; yes for CS2.
In CS1 we use Java in a standard
text-based edit-compile-run environment, writing programs
with standalone main
s.
In CS2, all assignments are written as Applets.
This was originally done mainly just for logistic reasons --
our campus doesn't have enough SparcStations or Windows95
PCs to guarantee sufficient access for all 70-100 CS1 students
per semester.
However, so far, this looks like it has turned out to be a pretty good arrangement. It is very hard to describe Applet construction mechanics to complete novices until they have had some experience with Java expressions, variables, methods, classes, and so on. But once they know these things, it is easy and fun to introduce Applets. (All this will surely change as better Applet development tools and environments become available. But even when these become available, it might still provide a better foundation to delay their introduction until students have a better idea of what's going on underneath. Or maybe not. Given that appropriate tools aren't available, I just don't have any opinion.)
Pretty much. Actually, we start off talking about problem-solving more generally, and computing more generally. But objects and classes are introduced almost simultaneously with expressions and statements.
Yes, it does take time. No, I don't think it is wasted time. It actually fits pretty well into the way that (at least my OOish version of) CS2 is built upon modeling:
On the other hand, there is some overhead that doesn't fit in all that well. Too much class time on logistics matters about using Netscape and Solaris and Win95 and so on. Plus, teaching enough HTML and related WWW mechanics to survive.
No; it's not even a goal. We teach concepts and skills appropriate to the course, and how to express them in Java, not the other way around.
No. Sun's (and other WWW) tutorials aren't all that useful for students learning Java in the context of learning Computer Science.
You'll want more computing power and better connectivity. But then, you always do. You'll also have to live with installing regular updates of JDK, HotJava, etc.
In our first year, we probably over-exploited how easy it is to learn basics; sometimes forgetting that it still takes time to gain minimal ``programming maturity'' in any language.
For me, the way in which CS2 students so readily adapt to the notion of building reactive, distributed programs on the internet, and how this, as much or moreso than the object-oriented aspects of Java programming, so fundamentally governs their attitudes on what programming is all about.
No, mainly because we haven't figured out yet how to do justice to these aspects of programming within the context of these courses. But see Lynn Andrea Stein's Rethinking CS101 project (MIT) that is attempting to do so.
Nothing formal. (Although some of my departmental colleagues strongly disagree, I think it's counterproductive to do any kind of long-range planning of Computer Science curricula beyond ensuring enough structural freedom to be able to adapt, evolve, and experiment with courses. The main undesirable consequence is that students in advanced courses have uneven backgrounds. So what.)
Most notes, outlines, examples, lab exercises, support code, etc., are being written as we go along. Some under-construction materials are available from my home page, Craig Graci's home page, and Rameen Mohammadi's home page.
Nothing beyond the tentative observation that so far, we've seen less attrition than when we used C++.
Sun used to maintain a list online, but it seems to have vanished. The ACM SIGCSE site also contains some related links.
Also, see some of the exchanges on Using Java in the ETS AP CS Exam .
View this page in Romanian courtesy of azoft