[Edu-sig] Turtle Graphics

kirby urner kirby.urner at gmail.com
Mon Dec 24 04:18:14 CET 2007


On Dec 23, 2007 8:06 AM, kirby urner <kirby.urner at gmail.com> wrote:

<< SNIP >>

> What's so good about Python in particular is the 'self' metaphor,
> while not a keyword, is very explicit and clear, enabling multiple
> turtles right out of the box.  The original Logo was more seeing the
> turtle as a "one and only" like a console or other i/o device.  The
> idea of "several" gets implemented in various derivatives.
>
> Kirby
>

I was thinking later, at some point during my long drive from
Monterey to LA today, via Rt. 1 (Big Sur) and 101 (Santa Barbara),
that the above isn't as clearly expressed as it could be.

I'm recalling something Alan Kay relayed during the Shuttleworth
summit in London, on behalf of Logo avatar Seymour Papert
(who was invited, but couldn't come).  Alan said that SP thought
it was OK to "make the receiver explicit" or something like that.

What did he (Alan) mean?

FD 10 or FORWARD 10 doesn't mention a specific turtle.   In
Smalltalk talk, "forward" is a "message" to an implicit object.

myturtle.forward(10), on the other hand, has an explicit "receiver"
(myturtle), the recipient of the "forward" message.

Python makes the receiver explicit by having us first create
an instance from a class e.g.:

mutant_ninja = Turtle()

mutant_ninja now (a) has its own self and (b) is an
explicit receiver for messages.  It remembers its own
state (pen up, pen down, pen color, xpos, ypos).  You
can squeeze these attributes out of self.__dict__ if
you really want to ("interrogating the self").

Given the "explicit receiver" motif, it's very easy to
think in terms of multiple turtles, each with its own
state.  This is natural to children because multiple
instances of any animal or object is the usual thing,
i.e. every noun has its plural form.

When I first introduce OO concepts, I usually speak
in terms of blueprints, designs.  "This blueprint for a
house (class) could be used to build any number of
houses, which we call 'instances' of the house class."
Likewise with turtles (multiple instances, one class).

So the distinction I was making was between original
Logo syntax, which doesn't explicitly mention the
turtle (because there's only one), and Python syntax,
which suggests multiple explicit instances, right out
of the box.

Kirby
in LA (finally -- 1290 miles since Thursday)


More information about the Edu-sig mailing list