<div><span class="gmail_quote">On 2/6/07, <b class="gmail_sendername">Peter Drake</b> <<a href="mailto:drake@lclark.edu">drake@lclark.edu</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">It's not that I'm going to do procedural first and objects later. The<br>vast majority of these students will never take another programming
<br>class. There is also a significant level of math phobia in this<br>course, so anything I can do to make it less complicated is a win.<br>Indeed, they spent the first couple of weeks with LEGO robots...</blockquote>
<div> </div>
<div>The OO paradigm is at first just a lingo, jargon, way of talking,</div>
<div>at first, very oriented around the "dictionary" in Python, as in </div>
<div>self.__dict__ and/or module.__dict__.</div>
<div> </div>
<div>I start with fuzzy animals (and/or not fuzzy, e.g. snakes) when working </div>
<div>with younger students, reminding them how natural it is, already, to think </div>
<div>in terms of blueprints or templates, then instantiated in the form of these </div>
<div>or those "instances of" -- all very embedded in our native grammar, if ya </div>
<div>know what I mean. Part of what made OO (ala Smalltalk) such a </div>
<div>breakthrough in the first place.<br> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I was under the impression that Python was trying to be<br>"multiparadigm", so you could program in a procedural, OO, or
<br>functional style. This doesn't seem to bear out for any but the<br>simplest programs, but I'm hoping I can pretend it's procedural for CS0.</blockquote>
<div> </div>
<div>It's true that you'll hear that, but just as often hearing "everything is an </div>
<div>object in Python" which is even more true of Python than of Java say, </div>
<div>cuz even the so-called "primitives" are also dissectable using dir(). </div>
<div> </div>
<div>One of my favorite "first day" trix is to go dir(1) and then talk about </div>
<div>the resulting dump.</div>
<div> </div>
<div>Basically, a key to Python, plus many other OO languages (Java, </div>
<div>Javascript, VB, VFP...) is "dot notation" (other languages might use</div>
<div>:: or ->). </div>
<div> </div>
<div>In explaining how somelist.reverse() "reaches into a list object for its </div>
<div>reverse method" I can't help but speak in terms of noun.verb() or thing.action(). </div>
<div> </div>
<div>dog.bark() or monkey.smile() just come naturally at that point, to where </div>
<div>you'd want a Dog and/or Monkey class projected on the Big Screen, </div>
<div>for students' collective edification.</div>
<div> </div>
<div>Kirby</div>
<div> </div></div>