[Python-Dev] re: PEP 279 revisited, formally
Wed, 24 Apr 2002 10:37:57 -0700
Paul Prescod wrote:
>Guido van Rossum wrote:
>>I'm +/- 0 on this. It saves a letter and may indeed suggest numbering
>>more closely, but it's an even more obscure word than enumerate().
>Is not obscurity a sort of virtue? If it hasn't been used in the
>languages space then it has no mental baggage. Compare with "Big
>endian", as obscure a reference as you'll find in computer science, I
>think. Or "thunk": a made-up word.
Let's try and approach this from a formal POV.
For a representative population of target users, if they see code using
name X, what is the likelihood of (a) - guessing the meaning correctly ;
(b) - guessing the meaning incorrectly; (c) - refusing to guess and
looking it up.
Now design a cost function C(a,b,c|X), and minimize over X. The details
are in the cost function particulars:
Paul's cost function says that what matters is minimizing b, even if
it means increasing c. A made-up word or one with no 'likely to guess'
meaning, is safest as far as that cost function is concerned.
Admittedly, it doesn't take into account the cost of looking things up.
Another cost function would be to maximize (a-b), ignoring c. That
is what people seem to be 'voting' on, I think, although more analysis
would be needed to make that a strong claim.
There seem to be anecdotal data flying (again =) indicating that if
either enumerate or itemize are chosen for X, a and b are likely to be
similar in magnitude and would dwarf c. Given that, the two cost
functions yield very different data.
What cost function do we want to apply to such things?
Do we have previous experiences with bad names that had bad
consequences? My personal "naming" problems in Python has to do with
never remembering the order of the two arguments to pickle.dump(). I
get it wrong about 50% of the time if I haven't been pickling recently.
Along the same lines, I have no problem remembering the name of the
pickle module, even though its relationship to the semantics are fairly
abstract at best. I'm reluctant to vote between enumerate and itemize
because I think Paul's onto something.
I'll close with an anecdote which is even harder to apply to the case at
hand. My mom recently got her first Windows PC after using macs for
years. I'm talking to her on the phone:
"How do I throw things off of my desktop?"
"Just drag them to the trash can"
"But there's no trash can ... . oh, there's a recycle bin -- but I
do't want to recycle, I want to throw it away!"