Skip to main content

Learning Computer Science: Where does Java Belong?

Posted by richunger on January 8, 2008 at 5:02 PM PST

In light of the article presented in the Journal of Defense Software Engineering, and the responses it has generated, I just couldn't resist throwing my 2 cents in, particularly as I'm killing time between job interviews.

If you haven't been following this debate, let me recap.  Some Ada experts are saying that the growing monoculture of Java in college curricula is damaging the quality of CS education.  It's producing software engineers who do not know how to engineer.

"Students found it hard to write programs that did not have a graphic interface, had no feeling for the relationship between the source program and what the hardware would actually do, and (most damaging) did not understand the semantics of pointers at all, which made the use of  C in systems programming very challenging."

I think Java is a wonderful language for teaching computer science.  However, they're not entirely wrong, either.

I bring the perspective of one who's been through such a curriculum.  Washington University was one of the first schools to jump on the Java bandwagon, thanks to the efforts of some wonderful professors.  I took the first iteration of CS 101 taught in that language, back in 1997.  Previously, CS 101 was taught in Scheme, and CS 102 was taught in C++.

The change in these courses were extremely popular.  We were able to build more substantial software in our first semester than students had in previous semesters.  In our first semester, we were already learning the rudiments of good object oriented design.  In our second semester, we were learning the rudiments of good concurrent programming.

However, the next year I took a Design Patterns class that was taught in C++.  I was completely unprepared.  I spent half the semester catching up to the kids who knew what pointers were, and how to do linking and write a makefile.  I didn't learn the Design Patterns until I took Advanced Design Patterns a year later.

The general attitude of most professors at the time was that students needed to get off their butts and learn the languages themselves.  The professors were teaching computer science, not programming.  <crotchety-old-guy>In my day, if we needed to use a different language, we bought a book and learned it in a week!</crotchety-old-guy>

Well, that may be fine if you learned Ada and are expected to pick up Pascal, but taking a student who's only been taught Java, and expecting them to go off and pick up C++ before class is going to cause problems.  They're not going to have the first clue how to run a linker, what a pointer is, or what the point of a header file is supposed to be.

This is exactly what the authors of the Journal article mean when they say:

...we have regretted the introduction of Java as a first language of
instruction for most computer science majors. We have seen how this
choice has weakened the formation of our students, as reflected in
their performance in systems and architecture courses.

WashU's student ACM chapter saw these problems, and put together their own curriculum for a lab-based class that taught these and other concepts behind good coding techniques.  We even chose a textbook.  We figured, if they would teach this class, that would free up the higher level systems and architecture classes to teach what they want, instead of the rush to the bottom that was occurring at the time.

Well, at the time, no one wanted to teach it.  However, I've heard they since introduced it, and students are finally learning how to code and debug before taking systems and architecture classes.

So, does all this mean that WashU made the wrong move?  I don't think so.  Java is not bad for education.  Bad curricula is bad for education.  They made some mistakes in the implementation, and then they fixed them.

The Journal's critique had 3 major themes:

1. Mathematics requirements in CS programs are shrinking.

Okay, if they're talking about discrete mathematics, numerical methods, and automata theory, this is clearly a bad trend.  However, WashU used to have engineering requirements in mathematics that just didn't make sense.  I don't need Laplace transforms to do CS.  I only need them if I'm going to work for Wolfram.

2. The development of programming skills in several languages is giving
way to cookbook approaches using large libraries and special-purpose

The fact that such packages are available for Java does not mean Java is bad for education.  My instructor for Algorithms and Data Structures allowed us to use C++
or Java, so long as we weren't just calling java.util.Hashtable to
write our hash table.  Nothing wrong with that.

3. The resulting set of skills is insufficient for today


Well, sure, you have to consider the source. However, I wouldn't really characterize it as an infomercial. They're steeped in Ada every day, and every project they see benefits from the kinds of things Ada is good at. They just have a limited perspective. The same is true of folks around here who're having a knee-jerk reaction to defend Java and use Java everywhere.

It should also be noted that this story was written by the president and vice-president of AdaCore. So it probably isn't a coincidence that they go on to rave about Ada, and say things like; "Ada is the language of software engineering par excellence". There's some interesting points in the article, but it looks like an infomercial to me.

Hi, this is one of the most even toned articles I've read about this subject in the last week. Thanks for taking the time to put your thoughts down.

True, John, but it all still needs to be taught at some point, or the students who've never been exposed to C are going to be really confused when you teach them Operating Systems, and all they've seen is Java up until that point.

That's why I liked our ACM chapter's solution of teaching a 1-credit lab course in coding techniques, debugging techniques, and C, using "The Practice of Programming" as a textbook. Students would take it after several courses taught in Java, but before jumping into the systems classes.

I never really understood pointers until after I learned assembly language... So does that mean that assembler is the first thing to teach?

Header files, linking, etc. are necessary evils related to generating an executable.... They have nothing to do with learning how to write "a good program".