C'mon, guys!

Barry Shein bzs at bu-cs.UUCP
Thu Jun 19 00:34:49 AEST 1986


Guy Harris writes:
>...sometimes I think pointers should be *subtracted* from C, since people seem
>to get very confused about them...
>...OK, maybe they're useful, and shouldn't be removed.  C classes should spend
>*lots* more time on them than they are doing, though, given these problems;
>better that people learn in class before they start writing code

Being as I teach a couple of C courses a year here at BU I thought I
would comment on this, perhaps it would be of some use to language
designers (or make them give up entirely!)

It's not 'C', I've had the same basic problems with students when
teaching IBM assembler, PL/I and Pascal.

There seems to be some fundamental problem with distinguishing
"the thing" from "the thing contained"*. In english (and probably
most other natural languages) we interchange these notions very
loosely as in "The White House said today..." or "she packed a
great lunch" (it's a little subtle, think about it, "I called 411"
is a similar conceptual variant.)

Somewhere in that mess they have to retrain themselves to carefully
distinguish between these two notions and not confuse a 'box' with
it's 'contents', an address with a value contained therein, to remember
two things for one object.

It's similar to the exasperating problem of teaching recursion (another
concept we are taught in language is actually an *error*, "don't define
things in terms of themselves!")

That is, it's more fundamental then simple language design although
design can affect the learning process. I believe C is actually
superior to, say, Pascal in this regard as Pascal never removes the
mystery from pointers (one exercise I will give a student having
conceptual problems is to printf some pointers in a meaningful
way as the program runs, such as when stepping through an array
with a pointer, try that in Pascal, you'll probably get a compile-time
error from the write() statement.)

Practice helps *IF* they can get past the first conceptual hurdles,
many never do. But then again, those that don't aren't writing to
net.lang.c, they're all in Law School...

	-Barry Shein, Boston University

* An amusing anecdote I've heard attributed to Marvin Minsky (who knows)
involves him saying angrily "YOU'RE CONFUSING THE 'THING' WITH 'ITSELF'!".



More information about the Comp.unix mailing list