On 5/26/06, <b class="gmail_sendername">kirby urner</b> <<a href="mailto:kirby.urner@gmail.com">kirby.urner@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br> So you're saying Python is sufficiently accessible because we may<br> still assume scientists and engineers are learning C++ and Java?<br><br> The fact remains: many academics are throwing up their hands when<br> encountering Python, because they can't make the leap from what they
<br> knew before. <br></blockquote></div><br>If I may, I'd like to start with a brief personal history to introduce what I see as two barriers to learning Python for "scientists/academics".<br><br>I learned FORTRAN in 1977 in a College-level course (pre-University in Quebec). I then went to University to study Physics. During my undergraduate degree, I wrote perhaps 3 (short) computer programs. Still, FORTRAN was easily understood as the stuff I did was mostly numerical work. *The concepts and language I had learned in Physics were easily adaptable in FORTRAN.*
<br><br>While in graduate school, I bought a PC and learned some basic C programming, mostly for fun. Again, I didn't write many programs, and they weren't very long. It did prepare me for what was to come. *The transition from FORTRAN and C was fairly easy, as I could write FORTRAN-style programs in C ;-).
<br><br>As a Physics prof, I wanted to introduce visual tools to my students. After learning about Java Applets, I decided that they were an ideal tool. So, I set up to learn enough Java to write my own applets for physics demo. I wrote a grand total of perhaps 10 applets over the course of 3 years, in between teaching and doing research. This was around 1995.
<br><br>The first barrier I encountered was the "dot" notation. Nowhere did I see it explain separately, as a notational convention, shared by many languages. I thought it was something weird about Java that I would have to learn.
<br><br>Solution: introduce the dot notation totally separately from the other programming syntax. This is something I tried to do in one rur-ple lesson.<br><br>The second barrier I found was the insistance on categorizing relationships in terms of "is-a" and "has-a". The examples that I would find most natural to look at were often counterintuitive. I remember in particular seeing that programming examples that use the relationships between a circle and an ellipse (or a rectangle and a square) seemed to have the relationship going backwards.
<br><br>Let me give a concrete example explaining inheritance for non-computer scientists.<br>===<br>class Father(object):<br> def __init__(self):<br> self.eye_colour = "blue"<br> def greets(self):<br>
print "Hello there!"<br> <br>class Mother(object):<br> def __init__(self):<br> self.eye_colour = "brown"<br><br>class Child(Mother, Father):<br> pass<br><br>Sally = Child()<br>
print Sally.eye_colour<br>Sally.greets()<br>===<br>The computer scientists in the (virtual) room are probably horrified. A Child is not a Mother, nor a Father and you do not have the proper "is-a" relationship. Yet, I would claim that the above example would be very appropriate for the average person. Sally inherit brown eyes for her mother, not because brown is the dominant gene (as in biology) in this case, but because of the inheritance order. (Interchange Mother and Father in the class Child and Sally will have blue eyes)
<br><br>Words like "inheritance" have been borrowed and adapted by computer scientists for use in their own discipline. They have been borrowed because they were familiar words that conveyed (partly) the concept used in the scientific discipline. They have been adapted because the usual definition was not technically correct. I believe that teaching those concepts should go through the same process: start with the familiar (but slightly incorrect) use of the word, and refine later on.
<br><br>This, btw, is how I use to teach about "work" in physics, so I have some idea about the possible use of this approach.. If I ask my son to carry the groceries bags from the car to the kitchen (essentially at the same horizontal level), he will not believe me if I tell him that he did no work. Yet, he would have done no work (W=0) [against gravity], as every physics textbook would tell you.
<br><br>==<br>As a final point about the personal history: after not having done any programming for about 8 years (and having never written any significant computer program), I decided to learn Python as a hobby with the goal to eventually teach my kids. By then, I had some idea about the dot notation, so this barrier was easily overcome. Python tutorials that I skimmed through did not insist on the importance of "is-a" and "has-a" relationship, so I didn't feel constrained in how I set up the relationships between the classes I wrote. I was free to explore (and make mistakes!) and it was fun! It still is.
<br><br>André<br>