[Python-ideas] Why decode()/encode() name is harmful
anatoly techtonik
techtonik at gmail.com
Fri May 29 10:56:44 CEST 2015
First, let me start with The Curse of Knowledge
https://en.wikipedia.org/wiki/Curse_of_knowledge
which can be summarized as:
"Once you get something, it becomes hard
to think how it was to be without it".
I assume that all of you know difference between
decode() and encode(), so you're cursed and
therefore think that getting that right it is just a
matter of reading documentation, experience and
time. But quite a lot of had passed and Python 2
is still there, and Python 3, which is all unicode
at the core (and which is great for people who
finally get it) is not as popular. So, remember that
you are biased towards (or against)
decode/unicode perception.
Now imaging a person who has a text file. The
person need to process that with Python. That
person is probably a journalist and doesn't know
anything that "any developer should know about
unicode". In Python 2 he just copy pastes regular
expressions to match the letter and is happy. In
Python 3 he needs to *convert* that text to unicode.
Then he tries to read the documentation, it
already starts to bring conflict to his mind. It says
to him to "decode" the text. I don't know about you,
but when I'm being told to decode the text, I
assume that it is crypted, because I watched a
few spy movies including ones with Sherlock
Holmes and Stierlitz. But the text looks legit to me,
I can clearly see and read it and now you say that
I need to decode it. You're basically ruining my
world right here. No wonder that I will resist. I
probably stressed, has a lot of stuff to do, and you
are trying to load me with all those abstract
concepts that conflict with what I know. No way!
Unless I have a really strong motivation (or
scientific background) there is no chance to get
this stuff for me right on this day. I will probably
repeat the exercise and after a few tries will get
the output right, but there is no chance I will
remember this thing on that day. Because
rewiring neural paths in my brain is much harder
that paving them from scratch.
--
anatoly t.
More information about the Python-ideas
mailing list