Python for non-programmers
Steve Holden
sholden at bellatlantic.net
Fri Mar 3 09:26:01 EST 2000
Donn Cave wrote:
>
> Quoth Steve Holden <sholden at bellatlantic.net>:
> ...
> | Dealing with Icon, Python and similar languages it's a lot easier to
> | teach to non-programmers by having the variables be fixed boxes which
> | contain pointers to "values" which live "out there" (you don't want
> | to start explaining heaps, stack frames, etc).
> |
> | An assignment is then just an optional creation of a new value (if
> | it has an expression on the RHS) followed by an overwriting of the
> | variable's contents with a pointer to the new value.
>
> Could dictionaries be introduced right away, at a conceptual level,
> while explaining variables? It sounds like we're trying to come to
> grips with something like ``existence of variables'', and along with
> ``what'' we need ``where'' to make existence mean anything.
>
> I'm suggesting that the idea of the dictionary and its role in the
> system should be introduced right away, especially for beginning
> programmers, long before the dictionary as an object type. Correct
> notions of scope and references comes pretty naturally from this idea,
> avoiding some common pitfalls.
>
> Donn Cave, donn at u.washington.edu
Well, now you mention it, I suppose all you have to do is draw a line
around the universe of discourse of my original mail and you have ...
a dictionary (without the complications of local variable optimization).
However, as a teaching model I would draw the line AFTER the contents
had been described rather than before; and I don't actually think it's
necessary, and possibly not desirable, to clutter a beginner's mind with
what are essentially implementation details.
Certainly this approach would make dictionaries easier to understand.
I like it.
regards
Steve
--
"If computing ever stops being fun, I'll stop doing it"
More information about the Python-list
mailing list