[Bluej-discuss] first languages
Stephen Bloch
sbloch at adelphi.edu
Sun Oct 14 22:24:10 BST 2007
Aryeh quotes me:
> > A number of the people on this list agree: Java is too complex to
>> teach as a first programming language, no matter how good the IDE.
> > Many of us use Scheme as a first language
and replies:
>What is worse too much semantic overhead or the syntax from hell??!?!?!?
Syntax from hell? All functions, whether built-in or user-defined,
are invoked using the exact same syntax rule. There's no ambiguity,
so you don't need to memorize a table of operator precedence. One
word, one semantics; there are no keywords (like "virtual" in C++)
that mean half a dozen different things in different syntactic
contexts. The only syntactic "concept" you need to learn is nesting,
which you would also need to learn in Java, C, C++, perl, Python,
Pascal, Fortran, BASIC, even HTML. In fact, I suspect the average
Scheme/Lisp program has LESS syntactic nesting than the average
program in any of those other languages, once you count parentheses,
curly-braces, square-brackets, and keywords (each of which has
different semantics). Anyway, a good beginner-oriented IDE like
DrScheme can help with the nesting, e.g. shading code between
matching parentheses.
>the best compermise I have found between the two from a teaching stand
>point is Mozart (www.mozart.org)... at one level it is a very
>semantically/syntactical clean lang but at a deeper level incorporates
>some features *I WISH* java did like real data flow variables vs. this
>hard to visualize mutex stuff.... an other advantage is if taught right
>(see Peter VonRoy's book [don't have an URL]) it introduces each concept
>at exactly the right time...
I've got the book, and have heard very good things about it, but
haven't had time to read much of it myself, much less learn Oz.
(That's on my to-do list for the next few months, as I consider using
Oz in a "principle of programming languages" course next semester.)
Introducing each concept at exactly the right time is an important
consideration. The way I put it (with regard to programming
language) is
1) Introduce only one language feature at a time;
2) Introduce each language feature only when it's necessary to convey
an important programming concept;
3) Corollary to 2: any language feature that doesn't help you teach a
CS1 concept doesn't belong in CS1, no matter how cool it is.
(For example, one of the dialects of Scheme shipped with DrScheme has
data flow variables, if I understand what you mean by that, but I
wouldn't dream of introducing them in CS1.)
>Mozart is functional and it is clearer ***BUT*** almost all functional
>langs are too dynamic for easy debugging and it is almost not to
>introduce some very non-mainstream concepts like monad's.
Something went wrong with that last sentence; could you type it again?
I do introduce (in a CS0 course full of theatre and history majors)
some "non-mainstream concepts" like higher-order functions, because
they're so easy to do in Scheme. Why are these "non-mainstream"?
Because they're difficult to express in C++, and even more difficult
(albeit more consistent) in Java.
As Lon mentioned, DrScheme's Stepper acts as a very nice beginner's
debugger, closely aligned with the execution model. It doesn't have
the bells and whistles of a professional-level debugger, but for
something whose user interface is three buttons, it's darn good.
--
Stephen Bloch
sbloch at adelphi.edu
More information about the bluej-discuss
mailing list