Popular conceit about learning programming languages

Skip Montanaro skip at pobox.com
Thu Nov 21 12:48:13 EST 2002


    Pascal> Could you try to describe what it means to you to think in
    Pascal> Python?  What makes it different from thinking in other
    Pascal> languages?  (This is not a rhetorical question!)

While you will be able to develop the same application in any of a number of
different languages, each language has its own best way(s) of doing things
that depend in large measure on its design.  Once you begin to see problem
solutions in the way the language's design encourages, you can be thought of
as "thinking" in that language.  I think of it sort of like walking
alongside an orchard.  If you aren't lined up with a row, you can't see very
far and the trees in the orchard may seem rather unorganized.  Once you line
up with a row, you can see a long way and the structure of the orchard
becomes immediately evident.

You see evidence of "not thinking" in the language a lot with newcomers to
any language.  The most oft-beaten dead horse (and an extremely shallow
example) in Python is its block structure.  People come from Perl or C or
any other language with explicit block delimiters and look at Python code
while thinking in Perl or C.  They see Python in terms of the other language
and want it to have block delimiters.  Other people come from more FP
languages and wonder why Python doesn't support closures well.  The answer
is generally that the way to do that in Python is to define a class.

-- 
Skip Montanaro - skip at pobox.com
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list