Protest letter concerning the proposed change to the AP CS exam to C++

February 8, 1996

I was very confused by recent messages soliciting comments on the change in the APCS exam to C++. I had thought that after the uproar last summer that the new "ad hoc" committee was going to be looking into the wisdom (or lack of same) of that conversion. I checked with Henry Walker, a SIGCSE appointee to the ad hoc committee, and he told me that it was made clear during their first meeting that the change to C++ was not open to debate. The notes of the 1st meeting of the AP CS Ad Hoc Committee on August 12-13, 1995 state "A July 11 letter of appointment indicated that the purpose of the AP CS Ad Hoc Committee was to "define the C++ language to be used in the Advanced Placement Examinations in Computer Science and advise as to the best approach to implementing C++ in the Computer Science Course". Later it says "The College Board and ETS are committed to changing the language of the AP CS Examination to C++. This decision was not open to discussion by the AP CS Ad Hoc Committee."

This was not what many of us were told was going to be the charter of this committee. Instead it appears to be an effort to whitewash the issue. (See the history of SIGCSE involvement in this - including notes of meetings.)

At the time that the proposal to change the AP course to C++ was made by the AP CS committee there was not actually a reasonable alternative language available. Pascal's use was declining (though it was still dominant), and people were looking for other alternatives. More people were moving toward C and C++ than other languages. The committee apparently believed that movement would eventually include a majority or healthy plurality of departments. A lot of us disagreed. (By the way, the latest figures that I have seen on language choice for CS1 have C in 4th place - behind Pascal, Ada and Scheme, and C++ in 6th place - behind Modula). The combined numbers for C and C++ give 16.5%, the same as the number 2 language, Ada, and well behind Pascal at 35.5%.)

I think that the weight of evidence no longer supports the belief in the eventual dominance of C++. Indications (for instance, reports on vendors from the OOPSLA conference, comments at panels, etc.) are that many programmers and organizations are rejecting C++ as being too complex and unreliable. Somewhat surprisingly, there are some indications that some are moving to Smalltalk as an alternative. (For example, Smalltalk seems to be the language of choice for many on Wall Street.) I personally don't favor Smalltalk as the language for a standard introductory course, but there is a new language which is a good alternative: Java.

Now Java and HotJava have been greatly over-hyped. In spite of this, however, Java is actually a very reasonable language (in contrast to C++). It retains the C++ syntax (unfortunately, from my point of view), but greatly simplifies the language. For example, all objects are references (implicit pointers), methods are virtual (unless declared otherwise), only call-by-value is supported (i.e., can't change that implicit pointer - can send messages to parameter which may result in a changed state), and garbage collection is supported. There is no need of having pointers in the language, so they are not supported (though aliasing and copying vs. sharing issues still arise). Arrays are actually safe (i.e., bounds are actually checked at run-time - though the checks may be optimized away). Most of these are features that one would find in a modern object-oriented programming language (e.g., Eiffel, Smalltalk, and to some extent Think's Object Pascal). The goals of Java (including architecturally neutral, portable, reliable, safe, long-lived, simple, ...) are usually ones that we share in introductory courses.

There are many fewer ways to screw yourself in Java than in C++. I believe the quote from Stroustrup is that in C it is easy to shoot yourself in the foot, in C++ it is easy to blow your whole leg away. Java designer James Gosling describes Java as "C++ without the guns, knives, or clubs". A major benefit of Java over C++ (to experienced programmers as well as introductory students) is that Java has a fairly simple conceptual model. The advantages of Java over C++ at this point seem overwhelming. I know in my department several faculty members are considering how we can move first our data structures course (CS 2) and then our intro course to Java. (This from both people who like C++ and those who hate it!) On top of everything else it even has sex appeal to students because of its use in web browsers and good supporting libraries for graphics.

Will Java be the solution to all of our problems? It's probably too early to tell right now, but I suspect it will be pretty obvious within the next 12 months, and it looks now like Java is going to be a winner. If this happens, very few schools will be teaching C++ in introductory courses by 1999, when the new ETS exam is first given. So, what should college faculty concerned about this do? I recommend the following:

  1. People should investigate Java and see how it works in practice. Look for good Java books for CS1 and CS2. I know Andy van Dam is porting his intro book from Object Pascal to Java. It should be excellent.

  2. Don't make an early commitment to C++. I'd be willing to bet that there is a rapid turning away from C++ to Java over the next several years. (I'm not saying C++ will go away, but it will not be the dominant language - especially in education - that some people were expecting.)

  3. Those who share my feelings that this is the wrong choice at the wrong time should send e-mail to that effect to the ETS ad hoc committee members. The e-mail address apc++@ets.org (which apparently is not operable until Feb. 10) can be used to provide feedback. You might also try sending mail to the APCS development committee, whose members are listed on the call for comments. You can also look up addresses of key people at ETS from the SIGCSE letter from last summer which complained about the choice of C++ without consultation (available from the SIGCSE page or the first web address above. Even if you are not sure that Java is the right choice, complain if you think C++ is the wrong choice. Give strong reasons for your choices. They will ignore rants.
By the way, you should also look at the set of topics that is planned for the C++ version of the course on the WWW page above.. Apparently there is no use of inheritance in either of the AP courses. These are definitely not courses which teach object-oriented programming. If you feel that object-oriented programming is important - at least in CS2, you should be pretty upset! I happen to think OO programming is important, and that it should happen at least by CS 2. At Williams College we would be very hesitant to place someone out of our CS 2 course who didn't know anything about object-oriented programming, no matter what language they knew. I'm sure that is true at an increasing number of other schools as well.

Two last notes on Java:

  1. It's not perfect. Aside from the ugly syntax, it currently has no support for parameterized types or classes (generics in Ada, faked via templates in C++ - see Eiffel for a better implementation). However, it appears they will add this capability in the near future.

  2. Java is not just a subset of C++. The syntax looks that way, but the semantics of similar constructs is different! For example, since all objects are references, passing an object as a parameter in Java has the same effect as passing a pointer to an object in C++. Passing the object as a parameter in C++ may truncate the object. I suspect it will take a fair amount of training to get C++ programmers to understand how to program in Java. Dealing with C++ programmers in a Java class may be similar to dealing with old-style Basic programmers in a Pascal class (instead of "where are my goto's" it will now be "where are my pointers").
It's hard to stop a huge bureaucracy like the ETS. Unless everyone who feels strongly that this is likely to be a big mistake complains strongly, they are likely to ignore us. Do your part!

	Kim Bruce
	Professor of Computer Science
	Williams College
	(former member of ACM/IEEE CS joint curriculum task force responsible
	 for ACM/IEEE CS Computing Curricula '91)
kim@cs.williams.edu