About languages
From MWCSWiki
UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY
I'd like to throw a suggestion on the table regarding our future choice of language(s) in our beginning course sequence. This grew out of a conversation a few of us had in Seacobeck the other day, and I think it's well worth considering. (Jennifer, Ernie, and Karen all contributed significantly to this.)
First, some unstated assumptions that I think all (most) of us have:
Assumption #1: We want our majors to leave here with significant experience in at least two different programming languages. (This is for breadth and experience if nothing else.) Assumption #2: We want one of these languages to be C++, since there are still important application areas (e.g., embedded systems, speed-critical graphical applications, device drivers) where that is the only practical choice.
I also have a third assumption which I've never heard discussed, and I may well be in the minority on, but let me state it anyway since it flavors the rest of this e-mail:
Assumption #3: The primary purpose of 110 is to give non-majors (and potential majors) an introduction to what computer science is all about, NOT to train future majors in specific skill sets that they will need for upper-level courses. Anything in the latter category is a bonus. (If nothing else, this is because 75% or more of 110 students will never take another CPSC class in their lives, and so giving primary attention to the latter is simply not serving the majority of students best.)
Now then, the suggestion. I propose that we teach the following languages in the intro sequence:
110 - Java (possibly preceded by Alice, pending Karen's experience this coming spring) 220 - Java 230 - C++ 330 - Either Java or C++, or (preferably) both
I believe this proposal has the following advantages:
1) Java is less intimidating, and easier to pick up, than C++. For non-majors, I can see no reason to make them undergo C++'s cryptic, counterintuitive compiler. For potential majors, it lets them experience more of the creativity that software development entails, and less of the pain, making the major more attractive. For future majors, it lets them concentrate more fully on the conceptual side of programming and less on the low-level details, which is desperately needed for students just starting to get their feet wet.
2) Java (and Alice) lend themselves better to an "objects first" approach than does C++, and several of us have expressed interest in moving in that direction.
3) 230 is the natural place to introduce C++ anyway. The underlying theme of that course is memory management: static vs. dynamic allocation, pointer fluency, creating composite structures in memory that have certain properties. I would argue that this is exactly the right point to make the switch to C++, explain the differences, and give students the "how memory looks under the hood" view of a computer program. 220, then, can be fully devoted to programming "in the small": how to combine a small set of programming building blocks to create branches, loops, functions, and collaborating objects.
4) If students learn Java first, I believe that understanding dynamic memory allocation in C++ may become easier. This is because in Java, *everything* is dynamically allocated, so students are already thinking in that direction. They will naturally want to use pointers and the "new" operator because that's the way to achieve what they're used to working with in Java.
5) It gives the 330 instructor a choice of languages, and also allows them to illustrate OO programs in *both* languages, both to contrast and to reinforce.
6) It plays nicely with high school classes, which are (as I understand) typically taught in Java. We could assume that graduates of 110 would be at about the same place, and with experience in the same language, as incoming high school students are, making 220 the logical starting point for both groups.
Responses to some possible objections:
- "Our adjuncts will balk if we ask them to switch languages." I'm not familiar enough with this place yet to know how likely this is, but I'll just go on the record and say that's pretty lame. I mean, how big a switch is this, really? Teach all the same stuff you did before, only in Java not in C++. They could even use Friedman's and Koffman's Java text!
- "Our adjuncts will never agree to teaching Alice." That's fine. Let them teach 110 strictly in Java instead. Graduates of their 110 class who wish to move on will still have what they need for 220.
- "C++ should be taught before Java because otherwise the switch will be too hard." This is the "drink your driest white wine first, then move gradually to the sweeter ones" theory. If people believe this, let's discuss. I, for one, don't buy it. The concept of writing a program is intimidating enough for newbies, IMO, that the last thing you want at an early stage is for anything unnecessary to clog up the works. I'd much rather have some low-level fluency I can count on when I throw out monkey wrenches than to throw monkey wrenches at the outset. But I haven't done this as long as the rest of you, so I'm more than willing to listen to arguments here.
All comments welcome. I'd also like to put this on the agenda for Dec. 4th's department meeting, if there's room?
- Stephen

