Python biases [was Re: My son wants me to teach him Python]

rusi rustompmody at gmail.com
Thu Jun 13 23:31:17 EDT 2013


On Jun 14, 5:44 am, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
> On Thu, 13 Jun 2013 06:37:34 -0700, rusi wrote:
> > Python-the-language has strengths that are undermined by the biases in
> > the culture of Python.
>
> This implies that there are strengths in Python-the-language which are
> not just missed or ignored by Python programmers immersed in the culture,
> but actively (if unconsciously) fought against.
>
> As someone immersed in that culture, and therefore at risk of being
> unaware of my biases, I am *very* curious as to what you think they are,
> and what strengths of Python you think I might be missing.

[This is more of an example than a full answer]
Lets say I have a 'kid' -- son, niece, student, whatever -- and for
some reason, we, both me and 'kid', feel its important to master
regular expressions.

Now regular expressions are there everywhere -- vi, emacs, perl,
python, awk, egrep, lex, ragel ... -- and so *technically* they are
quite orthogonal to the programming language issue.
Let us also assume that as a programming language, I definitely prefer
python over perl, in particular, REs in perl and python are more or
less equipotent.

However once we go beyond the technical basics of REs to a cultural
question -- asking more intricate questions on a forum -- I expect the
following to happen.

If (s)he asks an RE question on a perl forum I expect answers that are
cute, one-liner, zany etc but in a SE sense promote bad programming.
As a (cultural) rebound from that, when the same is asked on a python
forum, (s)he may get the hi-power RE answer. He is more more likely to
get a lecture on why REs are bad.

Now from a programming/SE angle, this is fine -- certainly writing an
ugly, buggy, inefficient RE where a few lines of beautiful soup (say)
would do better is poor practice. However lets remember that mastering
RE for its own sake is our agenda in addition to mastering
programming.

In short, I am not interested in perl for its own sake, yet the path
to RE-mastery in perl-culture is shorter.

So as guardian to my ward I have a simple evaluation to make:
"learn perl + python, learn REs in both, learn to translate REs across
the two"
is more or less work than
"Do everything in python"

Common sense suggests that the second is the less-work option.
Experience (may) suggest otherwise.

So much for my toy example. Now to more directly answer your question.

Here's Richard O'Keefe on the Erlang mailing list. Note particularly
the COBOL-Scheme reference.

-----------------------------------------
Once upon a time (about 1992ish) in a land where the moles
have beaks and swim and the deer jump on their hind legs
(Australia), a certain computer science department (RMIT)
decided that Pascal had reached its use-by date.  What shall
we do?  What shall we replace it with?  Set up a committee!
I was on the committee.  We set up a short list.
 (1) Scheme.
     Tiny language, amazingly capable, REPL so you can try
     things out, implementations for all the machines we
     cared about.  And Rob Hagan at Monash had shown that
     you could teach students more COBOL with one semester
     of Scheme and one semester of COBOL than you could
     with three semesters of COBOL.
 (2) Miranda.
     The commercial precursor of Haskell.
     Melbourne University were also looking at this (or had
     already switched to it) which would make it easier to
     pick up some of their students.
 (3) Ada.
     Close enough to Pascal that our staff were comfortable with
     it and our material would not need major revision.
     A better Pascal than Pascal.
     Handled concurrency about as nicely as an imperative language
can.

Personal Note:
For years Ive taught programming using two languages, one FPL, one
imperative language.
FPL  one of {Miranda, Gofer, Scheme, Haskell}
Imp. Lang one of {Pascal, C, Python}
If I had to do it again (and had the choice!) I would evaluate the
sets again. I would not go from 2 to 1.

------------------------------
tl;dr:

The shortest route to mastery of programming in some chosen language,
say python, may be to learn a bunch of contrasting, competing
languages.  Which others and how much, needs care and experience to
decide.




More information about the Python-list mailing list