[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

demur on recur




I'm sorry to be cantankerous	, but I really do not like the name RECUR.
I think it is setting up a pedgogical trap.

In my experience teaching programming, one of the things I find that I
need to overcome is students' tendency to confuse control structures
with particular syntactic keywords.  For example, many of then think
(possibly to due to Pascal-itis) that "iteration" means DO or WHILE.
This is a natural mistake for people to make, because general shapes
of process evolution (such as iteration or recursion) are much more
abstract than visible keywords, so it becomes easy to latch onto the
keywords and forget about the processes.

This is part of the reason why Gerry and I, in writing SICP, did not
use DO or any other iteration construct.  Where Kent says that he
wants students to realize that "iteration is a special case of
recursion" I am more concerned that they realize that "both iteration
and recursion are special cases of ordinary procedure invocation",
that is, that there is no magic going on in these constructs and that
once the interpreter can handle procedure invocation, all the rest is
syntactic sugar.

My objection to RECUR is that it is setting up a trap for students to
think that recursion is something that is done with RECUR.  I can
easily imagine some of them getting into a state where they believe
that there are two kinds of recursion: a "simple" one that is done
with RECUR, and a "general" one that is done with ordinary function
calling; and will somehow think that the interpreter handles these in
different ways.

So I am all in favor of getting rid of overloading the LET keyword --
as George said, puns cause confusion.  But let's not replace this with
a worse confusion.  Let's pick a name that does not imply any
particular control structure.