On Thu, 5 Oct 2017 07:17 am, ROGER GRAYDON CHRISTMAN wrote: > I teach a course in programming to students who have no plans to be > programmers, scientists, or engineers. And I deliberately lied today > about the for loop.
Well done! (I'm not being sarcastic.) This is entirely appropriate: all education is best understood as a series of "lies to children" asymptotically approaching reality, where "children" should be read figuratively not literally. https://en.wikipedia.org/wiki/Lie-to-children (If you prefer a more academic, philosophical term, Wittgenstein's Ladder is often used for more or less the same concept.) The term is provocative and evocative, but it is also slightly unfortunate in that some people (who should know better!) take issue with it due to an entirely avoidable misunderstanding of what is meant by "lie". E.g. the quote from Mishra in the above Wikipedia article *completely* misses the point; Kharem and Collura's lament that it is "stupidification". What are these people thinking? Is it stupidification to teach music students scales before atonal music? Do they honestly think that we should start teaching science with quantum mechanics and general relativity? (And even if we did, it would still be a lie: at *best*, QM and GR are themselves incomplete descriptions of the universe and therefore any description of reality in terms of QM or GR must be strictly false.) Strictly speaking, everything we human beings are capable of understanding about the universe falls short of reality and is therefore, in some sense, a lie. But lies-to-children are simplifications and half-truths which lead to better understanding, not outright porkies: "The pedagogical point is to avoid unnecessary burdens on the student’s first encounter with the concept." (Jeffrey and Corless, 2011, quoted in Wikipedia above.) Despite Mishra's opinion, "babies are delivered by the stork" is not a lie-to- children in this sense. Its just a dishonest untruth told by parents too embarrassed (or not smart enough) to explain where babies come from in a simplified, honest way to their children. Lies-to-children are not dishonest untruths. At various stages of education, we teach many lies-to-children, including: - supply and demand curves; - human beings make rational economic choices; - well, on average, human beings collectively make rational economic choices; - "AEIOU" are the English vowels; - the pyramids were built by slaves; - you cannot subtract a larger number from a smaller; - or take the square root of a negative number; - if the discriminant is negative, the quadratic equation cannot be factorized; - mass is conserved; - water is incompressible; - the gas laws; - Germany was the aggressor in World War 2; - well, Germany and Japan; - *surely* it must be Germany, Italy and Japan; - Hookes' Law for springs; - any table of values, or graph, used in engineering; - Newton's laws of motion; - Ampere's Law and Ohm's Law; - Special and General Relativity; - matter is made of indivisible atoms; - transformation of elements (such as lead to gold) is impossible; - there are three forms of radioactive decay: alpha, beta and gamma; - and two forms of carbon, graphite and diamond; - people and animals come in exactly two distinct sexes; - tides are caused by the moon; - well, the moon and the sun; Every one of these have to eventually be followed with: "Well, yes, that's kind of true *but* ..." > In my lecture slide, I said that the for loop could only be used if you had > a collection of values (e.g. list, tuple, dict, string, or range) > where all the data was in hand, and should only be used when > truly planning to visit the entire collection. Kastens & Chayes (2011) give some recommendations for effective use of the lies-to-children as a pedagogical technique. Since it is unavoidable to "lie" to your students, how can you make sure the lies help their education rather than hinder it? https://web.archive.org/web/20160205090900/http://serc.carleton.edu/earthandmind/posts/lies_children.html > The slide essentially claimed, you could not use the for loop to > input a series of values from the keyboard, until seeing a blank line or > zero. or to search a list until you found the first even value, and stopping > when you get there. > If you want to stop repeating for an arbitrary reason, you must use a while > loop. > > Deliberate lie. > > Verbally I said it was actually a fib, and that there was a way to > do these cleanly with a for loop, but it's a method that I postpone until > halfway through the second course for students in the major, > not the sort of thing I would teach to this particular audience this early. > > But yes, we can use yield, and iter(), and itertools to do both of these > examples very clearly with a for loop (and without an explicit break > statement), but I'd rather keep my course content small and simple. > > > Roger Christman > Pennsylvania State University >> > >> -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list