[Python-ideas] Make map() better
Steven D'Aprano
steve at pearwood.info
Fri Sep 15 21:58:17 EDT 2017
On Fri, Sep 15, 2017 at 08:03:32PM +0200, Jason H wrote:
> But really, I've learned a few things along the way. Though nothing to
> convince me that I'm wrong or it's a bad idea. It's just not liked by
> the greybeards, which I can appreciate. "here's some new punk kid, get
> off my lawn!" type of mentality. Dunning-Kruger, etc.
"The Dunning–Kruger effect is a cognitive bias wherein persons of low
ability suffer from illusory superiority, mistakenly assessing their
cognitive ability as greater than it is. The cognitive bias of illusory
superiority derives from the metacognitive inability of low-ability
persons to recognize their own ineptitude." -- Wikipedia.
If you're attempting to win us over to your side, stating that we're too
stupid to realise how dumb we are is NOT the right way to do so.
But since you've just taken the gloves off, and flung them right in our
faces, perhaps you ought to take a long hard look in the mirror. You've
been told that at least some of the changes you're asking for are off
the table because they will break working code. And that is still not
enough to convince you that they are a bad idea?
Breaking thousands of Python programs just so that people coming from
Javascript have only 99 differences to learn instead of 100 is not an
acceptable tradeoff.
Adding bloat and redundant aliases to methods, especially using
inappropriate names like "join" for append, increases the cognitive
burden on ALL Python programmers. It won't even decrease the amount of
differences Javascript coders have to learn, because they will still
come across list.append in existing code.
So these aliases will be nothing but lose-lose for everyone:
- those who have to maintain and document them
- those who have to learn them
- those who have to answer the question "what's the difference between
list.append and list.join, they seem to do the same thing"
- those who have to read them in others' code
- and those who have to decide each time whether to spell it alist.join
or alist.append.
I'm sorry that Python's OOP design is not pure enough for your taste,
but we like it the way it is, and the popularity of the language
demonstrates that so do millions of others. We're not going to ruin what
makes Python great by trying to be poor clones of Java, C++ or
Javascript, even if it decreases the learning time for people coming
from Java, C++ or Javascript by one or two minutes.
We're going to continue to prefer a mixed interface where functions are
used for some operations and methods for others, and if that upsets you
then you should read this:
http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html
--
Steve
More information about the Python-ideas
mailing list