[Bluej-discuss] bluej-discuss Digest, Vol 53, Issue 23
Barry Brown
barry at cs.sierracollege.edu
Wed Nov 28 21:40:52 GMT 2007
On Nov 28, 2007, at 10:12 AM, TJ Evert wrote:
> What's more simple (to a 1st-year student):
>
> a = b + c
> or
> a.set( plus(b, c) )
Taken out of context (as these expressions are), both are equally
confusing. The first one is obvious to programmers: the sum of b and c
are used to change the state of the "a" variable.
But to a student who has had only prior experience in mathematics, it
is clearly an assertion that "a" is immutably equivalent to "the sum
of b and c." Using the same prior knowledge, it follows, then, that
the statement can be re-written thusly:
b + c = a
or
c = a - b
or
a + 5 = b + 10 / 2 + c
or any of a multitude of other combinations. Raise your hand if your
students have tried these.
Teaching a first programming language that uses pseudo-algebraic
notation strongly favors students with prior experience in pseudo-
algebraic programming and is confusing to students who may be strong
in math, but otherwise lack experience in procedural programming. In
other words, the students who succeed in CS1 are those who come to the
class with pre-existing CS1-like knowledge. The others are left in the
dust. Is this how to encourage students to consider CS as a major?
By using a non-pseudo-algebraic language (Lisp and Scheme come to
mind; Smalltalk and ML, too), we "level the playing field," so to
speak. Everyone is equally confused.
Those with prior procedural programming experience have to "un-learn"
some of what they thought they knew about programming. By learning a
different style of programming, they come to think more abstractly
about problem solving. Win.
Those with strong mathematics skills are able to apply what they
already know about functions, recursion, and induction without
altering much (if any) of that knowledge. Win.
And those with weak mathematics skills sometimes make the best
students because you get to start with a blank slate. They learn
problem-solving skills that they can apply in their math and science
classes. (Dr. Bloch will tell you that they also learn how to write a
history paper.) Because they have to consciously convert from
algebraic expression notation to non-algebraic Lisp or Smalltalk
expressions, the silly precedence rules of algebra actually get
reinforced. Without anything to unlearn, an intelligent group of these
students can quickly find themselves at the top of the class. Win, win.
> Note - No joke: there's a growing minority of college instructors
> that are pushing for LISP to be a 1st-year language!
Is that a bad thing?
> There are extremes to any position. My aim isn't a reactionay
> throwback to assemly (or bit-coding Turing machines). The ultimate
> questions is "Will this help a student who knows *nothing* about
> programming?"
>
> However, the *real* $64,000 questions is "What prior experience does
> a 1st year computer science student have?" Some algebra, experience
> working with files, maybe a little bit of logic with Venn diagrams.
> So (especially in the first semester) why not use what they're used
> to: algebraic statments, Boolean algebra, control structures -
> procedural programming!
>
I can tell you with certainty that the syntax-overladen control
structures of Java/C/C++/Perl/PHP frustrate the majority of CS1
students who have had no prior experience. By contrast, almost every
one of my CS0 [not a typo] students can write a correct Scheme cond
expression.
-B
More information about the bluej-discuss
mailing list