[Edu-sig] Using objects early was Procedural front end for Zelle's graphics.py

kirby urner kirby.urner at gmail.com
Wed Feb 7 18:02:03 CET 2007


>
>
> I'm wondering what others on the list think about this subject. As I look
> to
> revising my textbook, one of the things I'm carefully considering is the
> fact
> that use of the string library is, if not deprecated, greatly discouraged.
> In
> the first edition, I move from functions with numbers to functions with
> strings as a way of building on students previous experience with
> "computing"
> in the context of mathematics. Objects are introduced slightly later
> through
> computer graphics examples. If I switch to using string methods, then the
> object notation will be introduced even sooner. In your opinions, is that
> a
> good thing, a bad thing, or doesn't it matter?
>
> --John


I agree that even if avoiding defining classes (at first), understanding dot
notation
is critical to Python and many other languages using that syntax.  There's a
sense
of container and contained, in "drilling down" like in a filesystem, finding
resourses
*within* an object.

In the old days, rational numbers (to take an example) were considered a
type
of number and members of a set (the set of rational numbers).  But what was
the
relationship of operations, such as addition and multiplication vis-a-vis
this set?

In the OO paradigm, there's this paradigm class (or type) called the
Rational Number
class, which contains within it all the "guts" for doing operations, so
whereas
*instances* Rat(p,q), p,q integers, are akin to our "members of the set",
the
operational know-how is actually codified in a template or blueprint shared
by
these instances.

But in the computer world, we're not just interested in "types of number"
per se,
but in "types" more generally, which includes strings, other collections.

We model stuff in the real world, such as airplanes, animals, DNA, always
using
these same concepts of (a) blueprint with guts (methods) and (b) distinct
instances
sharing these guts.  I like starting with Animal types at first because
animals already
have lots of guts.  :-D

In my idealized CS0, understanding this paradigm, of objects (things) as
instances,
of classes as encapsulating and structuring their "guts" (verbs, abilities,
powers),
is the important thing to get across.  Intro courses are characterized by
their ability
to rise above the petty day to day, to give overview, to survey.  Lots of
history, lots
of (true) war stories.  Best if your teacher has plenty of real world
experience.

Kirby

Relevant essays:
http://www.4dsolutions.net/ocn/oopalgebra.html
http://www.4dsolutions.net/ocn/trends2000.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/edu-sig/attachments/20070207/029dd076/attachment.htm 


More information about the Edu-sig mailing list