Jun 05 2008
java vs scheme
Last semester, I introduced my students to structured data (including how to traverse self-referential structures), transitioned into classes and objects, and the basics of constructing GUIs in the object-oriented paradigm. A number of them mastered Model-View-Controller in this transition. This isn’t entirely remarkable—it’s actually a simple pattern, when the language itself doesn’t get in the way.
A Java program that produces this:

Comes from code that looks like this:

Of course, the output from the Scheme version looks the same:

But the difference is in the amount of code the student has to write:

What do I like about this?
- There’s less preamble (
#lang scheme/guivs multiple imports). - The syntax is consistent with what has come before in the student’s experience.
- There aren’t any mystery calls (
frame.pack()?). newis analogous tomake-, which students have seen many times before.- Callback functions follow naturally from previous work; event handlers are confusing.
I could probably make the list go on and on. At some point, I have to spend more time with JavaME, as it has a much simpler GUI model. And, given that the vast majority of the computers—those would be mobile phones—run JavaME (and not the full Java stack), it would be good to ask around and find out whether we’ll ever see a native version of BlueJ for programming against the ME classes.
Or, it could just be I prefer introducing students to simple languages, and then moving them on to more complex languages as necessary. But this is an old and tired rant, at best.