How to name things [Was: Re: SO rotate question]

bearophile bearophileHUGS at lycos.com
Fri Sep 3 10:14:24 PDT 2010


Jonathan M Davis:
> Still, naming functions is a bit of an art and most function names are
> debatable as to how good they are, so you're bound to have functions
> in any API that aren't named the way that you think they should be.

I don't like what you say.

If you take a look at how in the last ten years every small feature was designed by Python devs, you see how much care they have for naming things. For each name of feature/built-in all people of the development mailing list propose their names and the rationale behind those names. Then they write down a list of all the ideas, and they vote for each name. The name with most votes usually gets accepted, and then they start over with the next name to choose. This is a bit time consuming, but one of the most important qualities of Python its refined and natural design.

You are right that good names are purpose-specific, and often a name that is good for me is not good for you.

Every single person has some quirks, so if you let a single person choose a name, there's some risk the name will reflect only the specific quirks of that person.

On the other hand the good names for a specific feature are not totally random. If you take 100 smart persons, and you ask them what name to use to define a certain feature, you will often receive something like 15-20 answers, and among them one or two answers are the most common. The most common choice is the the right name choice.

It's true that this most common name is not always the same name that each person is willing to chose, but such average process smooths out the quirks each single person has, and very often the names chosen by this process are simple to remember and natural.

This is how I'd like Phobos names to be chosen. Andrei is smart and intelligent, but as everyone else he has quirks (and his usage of English is not the most common you may find), so letting the choice of many names to any single person is bad.

-----------------

I have also added this one:
http://d.puremagic.com/issues/show_bug.cgi?id=4803

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list