[Edu-sig] Why Python?
macquigg at ece.arizona.edu
Mon Apr 12 18:30:50 CEST 2010
Edward Cherlin wrote:
> On Sun, Apr 11, 2010 at 21:03, Andrew Harrington <aharrin at luc.edu> wrote:
>> My choices are always about me and a particular situation. I would not
>> teach J to beginners
> I would use the +-*% (+-×÷) subset of J in first grade for arithmetic,
> alongside Turtle Art (with stack tiles), and Etoys, including
> Scratch. By third grade, we could introduce programming in J/APL,
> Logo/LISP, FORTH, Python, and Smalltalk. At some point, we could show
> how each represents the same internal parse tree in quite different
> textual forms. What the LISPers call "syntactic sugar". This is a
> fundamental Computer Science concept.
>> or to people not crunching a lot of mathematical stuff
>> regularly, but for the professional statisticians and electronic traders I
>> know, J is a fabulous language, and very worth the modest learning curve.
> J would enable children to crunch data sets easily, allowing a radical
> deepening of every subject. The learning curve would be very modest
> when integrated with arithmetic and elementary science, and applied to
> languages, history, geography, health, and gym.
>> David MacQuigg wrote:
>>> Edward Cherlin wrote:
>>>> Christian Mascher wrote:
>>>>> Edward Cherlin wrote:
>>>>>> Do math tables in a math array language.
>>>>>> degrees =. i. 91 NB. 0..90
>>>>>> radians =. degrees * o. % 180
>>>>>> table =. |: degrees, 1 2 3 o./ radians
>>>>> Python is much nearer to standard Math-notation, that is a good thing.
>>>> LOL. Math notation is what mathematicians use, not schoolchildren.
>>>> They are constantly inventing more of it. What you call math notation
>>>> is known to mathematicians as "arithmetic".
>>>> There is no standard math notation.
>>> I think what Christian means to say is that Python is much nearer to a
>>> notation (pseudocode) that might be used by scientists and engineers who are
>>> trying to express an idea involving computation, without relying on a
>>> specific language. Of course, there is no "standard" pseudocode, but if you
>>> look at textbooks that are most successful at expressing algorithms this way
>>> (my examples would be from engineering - Hachtel & Somenzi on Logic
>>> Synthesis, Stinson on Cryptography) what you see is a notation very close to
>>> Pseudocode has to be self-explanatory. There is no introductory chapter
>>> on how to read it.
> We consider pseudocode "self-explanatory" to those who already know
> the syntax of a similar language. But it is not so, any more than
> mousing and icons is "intuitive" for those who have never seen them. I
> consider my J example _with explanatory comments_ to be simpler than
> the Python I was starting from, where it must be assumed that students
> have had a prior introduction to the syntax.
You may have a good point here. The C family of languages (C, Java,
Python, ... ) has so permeated our culture that we now have a bias to
that way of thinking, and difficulty understanding languages from the
APL family (APL, J, K). I don't see any signs that the world is moving
to APL-think, LISP-think, or any other programming paradigm, so if
students are introduced to programming in some other style, there will
be a problem in transition to C-think, a much bigger leap than moving
from Python to Java.
There must be a real, demonstrable benefit to an alternative paradigm,
or it isn't worth the added effort of learning two. Note: I am talking
about the majority of students, not those truly interested in CS, for
whom learning the alternatives is a great benefit. Personally, I love
exploring alternatives, and have even participated in an attempt to
one-up Python (Prothon). It's interesting to speculate whether there
will ever be another major improvement in programming, a step beyond
Python, or if Python will simply incorporate any good ideas that come
along (as it did with our @ syntax). I would bet on the latter.
>>> Likewise, an introductory computer language should be
>>> close to self-explanatory. It will be difficult to get math and science
>>> teachers to accept it, if they have to make extra efforts explaining the
>>> notation. Getting math and science teachers to accept computation as a
>>> vital part of their curricula is my current focus, so I wouldn't try to push
>>> something like your example above.
> There are a number of math, science, and Computer Science textbooks in
> which APL or J is the math notation throughout, being taught only as
> needed without interrupting the main sequence of ideas. I can give you
> citations. There is very little done in this manner in any other
> programming language. (If you have seen some, please send me the
> information.) I much prefer this approach to the usual one of teaching
> programming language syntax and semantics in a vacuum, with no
> systematic application to anything.
I agree that the earliest introduction to programming should be in math
and science classes, without interrupting the main sequence of ideas, or
forcing any more programming than is helpful to support the subject
being taught. Later, we can add a little more than the minimum, not to
train future programmers, but with the motivation that "computational
thinking" is good for all students.
The availability of good textbooks (not just programming manuals) is one
of Python's advantages (compared to other agile languages like Ruby). I
don't teach high-school, so others on this list may have better
recommendations, but if I were teaching at that level, I would chose
either Elkner's How to Think Like a Computer Scientist
(http://openbookproject.net/thinkCSpy/index.html) or Litvin's
Mathematics for the Digital Age. The latter seems like an especially
good example of integrating computational thinking into the existing
curriculum. I might start with that, then for students who are really
interested in CS, maybe Elkner, or Zelle's Python Programming, An
Introduction to Computer Science, or even my personal favorite -
Goldwasser's Object-Oriented Programming (a bit more advanced, but
surely no more difficult than senior calculus).
>>> Python is just a means to an end, the closest thing we have to pseudocode.
> APLers tend to find pseudocode irritating, because the APL is shorter
> and clearer to those who can read it.
>>> When someone who favors another language (typically Java) asks me why
>>> Python, I find the comparison to pseudocode to be the best answer. Specific
>>> examples, like the absence of type declarations, tends to invite unthinking
>>> reactions. (Students will make too many errors.) Even something as simple
>>> as requiring correct indentation is not obvious to someone who hasn't used
>>> Python. (Although that one does have some appeal to teachers who have had
>>> to read sloppy student code.) Ultimately, it is word-of-mouth, one teacher
>>> telling another, that I think will decide which language gets used.
More information about the Edu-sig