<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hi David,<div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">I teach at DePaul university where we now use Python in multiple classes. The way we got it in was not by proposing Python in substitution to Java or C++. I tried it and that failed for the same reasons you mention. I got it in by starting to use Python in algorithms classes instead of pseudo code (and I did not permission to do it). Python also works great in web development courses (we have a course on web frameworks and we use web2py) and networking courses.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Personally I believe that typical intro programming courses are obsolete because the target population has changed. When our students come in, although they cannot program, they already understand the concept of network, data transfer, input/output, files. I think it is easier to teach programming by teaching how to manipulate these high level structures and then work your way down to loops and conditionals that to do it the opposite way, the way we used to do it.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Massimo</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br class="webkit-block-placeholder"></div><div><div>On May 5, 2008, at 7:24 PM, David MacQuigg wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I talked with the CIS department chairman and one of the faculty about the possibility of teaching Python at our community college, and they weren't interested.<span class="Apple-converted-space">  </span>(Oh No, not another language ... )<span class="Apple-converted-space">  </span>Also, the lack of declarations was a show-stopper.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I encountered this same objection from one of the faculty at U of A, where I just gave a lecture.<span class="Apple-converted-space">  </span>It doesn't seem to help when I say: In four years of using Python, I can remember only one time when I had a subtle error from mistyping a variable name that took an hour to track down.<span class="Apple-converted-space">  </span>I'll gladly trade that hour for the dozens I've saved not having to read and write all these declarations.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've added this to my QnA page at <a href="http://ece.arizona.edu/~edatools/ece175/Lecture/QnA.txt">http://ece.arizona.edu/~edatools/ece175/Lecture/QnA.txt</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">'''</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Q2: Without variables declarations, isn't there a problem with mistyped</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">variable names leading to subtle errors?</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">A2: It can happen, but the subtle errors are rather rare.<span class="Apple-converted-space">  </span>Usually you will</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">get an immediate and clear message like:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>Traceback (most recent call last):</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">    </span>- - -</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>NameError: name 'z' is not defined</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">where 'z' is the name you intended to type.<span class="Apple-converted-space">  </span>The subtle error can occur if z</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">is already defined, and you intended to re-define it.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">If you worry about errors like this, you can scan your program with a</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">utility like pychecker, and it will detect any variables that are defined</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">but never used.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">'''</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Still, I wonder if there isn't a better way to handle this objection to Python.<span class="Apple-converted-space">  </span>I'm thinking of a configuration option in IDLE, something that will either:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">1) Run a subset of pychecker tests every time you hit the Run button, or</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">2) Insist on declarations in a comment at the start of every function (just the names, not data types).<span class="Apple-converted-space">  </span>Any name that isn't already declared gets immediately painted red.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I would use #1 if it was no time penalty.<span class="Apple-converted-space">  </span>#2 seems like "training wheels" to me, but I would expect some folks who are religious about declarations might at least find it re-assuring.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-- Dave</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Edu-sig mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:Edu-sig@python.org">Edu-sig@python.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://mail.python.org/mailman/listinfo/edu-sig">http://mail.python.org/mailman/listinfo/edu-sig</a></div> </blockquote></div><br></div></body></html>