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

Jonathan M Davis jmdavisprog at gmail.com
Fri Sep 3 14:22:39 PDT 2010


On Friday 03 September 2010 10:14:24 bearophile wrote:
> 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 didn't say anything that contradicts what you just said. All I said was that 
picking a function name is an art, and there _are_ going to be function names in 
an API that people aren't going to like simply because they think differently. 
Heck, you could really like one of your own names when you first create the 
function, and then later decide that it was a poor choice.

What you're proposing is a way to reduce the odds that the average programmer 
will think that a name is bad, because more people will have input. I have no 
problem with that, and I didn't suggest that the way that names in Phobos is 
picked is perfect. I didn't even say anything about whether having one person 
pick the names was good or bad. So, I really don't know why you're unhappy with 
what I said.

In any case, it looks like Andrei is looking to have more of a review process 
for stuff entering Phobos - akin to what Boost does. That review process would 
likely be the time to suggest better names for functions if they are poorly 
named.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list