On 2/6/07, Peter Drake <[EMAIL PROTECTED]> wrote:

It's not that I'm going to do procedural first and objects later. The
vast majority of these students will never take another programming
class. There is also a significant level of math phobia in this
course, so anything I can do to make it less complicated is a win.
Indeed, they spent the first couple of weeks with LEGO robots...


The OO paradigm is at first just a lingo, jargon, way of talking,
at first, very oriented around the "dictionary" in Python, as in
self.__dict__ and/or module.__dict__.

I start with fuzzy animals (and/or not fuzzy, e.g. snakes) when working
with younger students, reminding them how natural it is, already, to think
in terms of blueprints or templates, then instantiated in the form of these
or those "instances of" -- all very embedded in our native grammar, if ya
know what I mean.  Part of what made OO (ala Smalltalk) such a
breakthrough in the first place.


I was under the impression that Python was trying to be
"multiparadigm", so you could program in a procedural, OO, or
functional style. This doesn't seem to bear out for any but the
simplest programs, but I'm hoping I can pretend it's procedural for CS0.


It's true that you'll hear that, but just as often hearing "everything is an

object in Python" which is even more true of Python than of Java say,
cuz even the so-called "primitives" are also dissectable using dir().

One of my favorite "first day" trix is to go dir(1) and then talk about
the resulting dump.

Basically, a key to Python, plus many other OO languages (Java,
Javascript, VB, VFP...) is "dot notation" (other languages might use
:: or ->).

In explaining how somelist.reverse() "reaches into a list object for its
reverse method" I can't help but speak in terms of noun.verb() or
thing.action().

dog.bark() or monkey.smile() just come naturally at that point, to where
you'd want a Dog and/or Monkey class projected on the Big Screen,
for students' collective edification.

Kirby
_______________________________________________
Edu-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to