Java as a Teaching Languageby Bruce Stewart
Java is well on the way to becoming the predominant instructional programming language. The significance of this cannot be overstated--training our future computer scientists, programmers, and IT (information technology) executives in Java will lead to even more acceptance of the language in society at large, putting Java solidly at the forefront of many IT efforts.
The Gartner Group first studied the prevalence of Java in U.S. college and university curricula in late 1997, finding at the time that Java had made a sizable impact in this area. Today Java continues to grow in importance in computer science programs, while C++, the previous mainstay of CS instructional languages, is on the decline.
The reasons for Java's success as an instructional language are basically the same reasons Java became a successful object-oriented programming language in the "real world." Java is relatively easy to use; it gracefully handles some of the tedious programming chores other languages impose on programmers; and many of its users even considered it fun to code in. Of course, Sun's extensive efforts to install Java in university curriculums haven't hurt either.
This article will take a look at the role Java plays today as an instructional programming language and highlight some schools that are successfully using Java. We'll examine the factors that led to Java so rapidly becoming the predominant teaching language for CS students and why it is displacing C++ from that role.
There is no shortage of online information about Java and education, including Sun's own massive SunEd site. One of the early independent sites focusing on Java as a teaching language was created by Doug Lea, a faculty member of the computer science department at the State University of New York (SUNY) Oswego campus.
When asked why the page hadn't been updated in the last couple of years, Lea's response was indicative of how far Java has come in this area. "That Web page hasn't been updated mainly because the use of Java in CS programs has become so commonplace that there's not much interesting to say about it any more," explained Lea.
When the Gartner Group first studied the prevalence of Java in 1997, Java was being taught in 78 percent of surveyed schools, and was mandatory in 50 percent of the CS programs. C++ was identified as the primary instructional language in these institutions, and it was taught almost across the board, in 95 percent of schools, and was required in 82 percent of CS programs.
Gartner revisited the question in early 2000 and found the trend of Java's rise continuing, along with a corresponding decrease in C++ as a teaching language. In January 2000, Java was now being offered in 87 percent of the surveyed schools, and was mandatory in 56 percent of the CS tracks, whereas C++ was being taught in 87 percent of the institutions, and was mandatory in only 65 percent of the CS departments. Additionally, 13 percent of the surveyed schools had or were in the process of replacing Pascal with Java, and 21 percent were replacing C++ with Java.
Registration is now open for the O'Reilly Conference on Enterprise Java, March 26-29, 2001, in Santa Clara, California. Topics to be covered include XML, security, servlets, wireless, internationalization, and more. Register by March 2 and save up to $400.
The trend isn't just being observed at the college level. A significant development for Java is the recent decision by The College Board that the AP (Advanced Placement) Computer Science curriculum be revised to include object orientation and to use Java as the delivery language for the AP Computer Science Examinations, beginning with the 2003-2004 academic year. AP tests are taken by top high school students to receive college credit for advanced knowledge. The inclusion of Java in AP exams will therefore trigger widespread Java instruction at the high school level to prepare our future computer scientists for the new Java-based AP exams.
Java has many features that make it a popular instructional language, most of which are the same features that caused Java to be a popular language among programmers in general. Java's object-oriented design, portability, garbage-collection feature, strong graphical interface capabilities, networking orientation, and relatively simple structure all add up to a powerful language that works well in a modern teaching environment.
A Sun white paper notes that Java is more purely object oriented than C++ in that it requires the use of objects. There are no global variables or functions; all interfaces with an object's data must be defined in the class libraries. This structure practically forces the lessons of object-oriented programming onto today's students.
Java is considered a "strongly typed" language, which means it doesn't allow operations such as assignment and comparison among variables of different types. In those cases, the compiler issues an error prohibiting the operation. These strict rules regarding data types are designed to avoid potential errors.
One advantage of the strong typing of Java is that it allows the compiler to find many problems that in other languages won't cause errors until a program is run. Beginning programmers tend to find decoding compiler error messages an easier task than understanding strange run-time behavior.
The feature that programmers and teachers most praise is Java's garbage collection. By not forcing Java programmers to handle the tedious and often complex chore of reclaiming the memory that programs use, many see Java as a vast improvement over C++. The most common and difficult problems students have when coding in C++ are related to keeping track of memory allocation. This whole issue can be blissfully ignored when using Java, thanks to its automatic garbage-collection feature.
Marc Loy, a Java instructor and coauthor of O'Reilly's Java Swing, points to the ease of building graphical applications as one reason Java is well suited for an instructional language. "Beginning students can build real, live windows with buttons as they learn programming. This is a tremendous leap forward from the command-line interactions of old C, Pascal, and Fortran programs," said Loy.
Since these interfaces look much like the applications students use everyday, they get a better grasp of the fact that they can write real programs if they stick with it. Loy added, "That ability to motivate the student to want to know more is also a key to Java's usefulness in the classroom."
Professor John Rosenberg, Dean of Information Technology at Monash University in Australia, likes Java's compact size and clean structure. "You can teach all of Java in two semesters. It has very few exceptions. The syntax and semantics are clean and straightforward," said Rosenberg. Java's portability and platform independence are also cited by Rosenberg as important factors--students can work on their projects practically anywhere. O'Reilly Java editor Mike Loukides agreed that the clarity of Java's code is an important factor to educators. "I think that one reason Java has succeeded as a teaching language is that Java code is extraordinarily clear, relative to other languages," he explained.
Another factor that cannot be ignored in Java's acceptance in academia is student and faculty enthusiasm toward the language. In a world increasingly dependent on network services, and with a job market in which Java developers are in high demand, the desire to learn and teach Java continues to grow. The same Gartner Group study also predicts that less than 50 percent of the market demand for Java developers will be satisfied through the end of next year. Students see Java as an important language, and they are enthused about learning it.
It's not just in the U.S. that Java has been embraced as a teaching language. The Computing Laboratory at the University of Kent has recently become an "Authorized Academic Java Campus (AAJC)," which means students that complete a CS degree at Kent will also get the opportunity to take Java certification tests and receive a Sun certificate in Java programming and development. Also, Monash University in Melbourne, Australia is a big believer in Java and has developed BlueJ, an Integrated Development Environment (IDE) for teaching Java using Java.
Java is Here to Stay
As more and more schools jump on the Java bandwagon, it's clear that it is a good choice for a first-year teaching language. Monash's Rosenberg says, "I believe that the object-oriented approach to programming is the most appropriate to be teaching to first year students. Java is the most elegant and the cleanest object-oriented language available. It simplifies the teaching of the basic principles, but is powerful enough to see students through to the advanced concepts."
Java has now displaced C++ as the main instructional programming language. This year's Gartner Group study shows the relative increase in schools teaching Java (9 percent) almost exactly matching the decline in schools offering C++ (8 percent), compared to the previous study. Rosenberg agrees that Java should replace C++ as the primary teaching language, noting that C++ was always a poor choice as an instructional language because it is too large, complex, and inconsistent. Lea, from SUNY Oswego agreed. "I suspect Java is now the most widely used language in college and university CS courses," he said.
One must question whether supply can keep up with high demand for Java in our academic institutions, starting at the high school level. Sun's Academic Programs Manager, Jerry Neece concurred. "We can't keep up with the demand from students and we certainly need a lot more Java instructors."
The trends in modern computing also justify the inclusion of Java in academia. As e-commerce proliferates, Java servlets are proving their value in the back-end systems that are becoming a business staple. With peer-to-peer and distributed computing growing in importance every day, Sun's long-held slogan of "the network is the computer" is finally being realized, and Java will play a key role. The security and portability of Java make it an excellent choice for P2P and distributed models of computing.
Educators and savvy computer science students have been paying attention to these developments, so it comes as no surprise to them that Java is now firmly entrenched in university computer science programs. At last count there were more than 2,000 books on Java in print. Java has found its niche in the academic world and so, it seems, in the future.