On Sat, 16 Oct 2010 18:04:23 -0400, Walter Bright
<newshou...@digitalmars.com> wrote:
Steven Schveighoffer wrote:
On Sat, 16 Oct 2010 16:31:34 -0400, Walter Bright
<newshou...@digitalmars.com> wrote:
If I google for "adapt for D" I'll get a hopeless mess of irrelevant
links. "duck typing for D" should be much better. Remember that google
ranks pages by relevance, and searching for "duck" will give higher
ranking for pages with "duck" in the url, title, headings, etc. That's
just what we want.
And it should come up with the page on digitalmars.com titled 'duck
typing in D' which describes how to use templates or the adaptTo type
to achieve duck typing.
When writing fiction, it's a good idea to constantly shift which words
used to describe something. But when writing tech manuals, and when
making things search engine friendly, it pays to use a single term and
use it consistently.
For example, once upon a time I read some article on arrays, and it
variously referred to the array "elements", "entries", and "values".
Really, that sucked, as the reader was left being not quite sure if they
meant the same thing or not.
If you expect people to search for "duck typing" (and I do) then why
stick another level of indirection? Call it a "duck". When you find
yourself constantly saying "duck typing: see adaptTo", then you named it
wrong.
Is this a case of foresight is 20/20? Look, you can't predict the future,
and knowing what you will constantly be saying isn't possible. You could
constantly be saying 'yeah, I know duck isn't the only way to do duck
typing in D, but we felt it was a good descriptive name.' And not having
to constantly say anything isn't proof that you have preemptively avoided
it.
But it doesn't matter anyways. My point is, marketing has nothing to do
with naming functions. People will not decide to use or not use a
language based on a function name. If the name describes the function
properly, then it will not be noticed as a defect, and few will have
problems with it. All three suggestions (adaptTo, as, and duck) satisfy
this IMO, so really this argument has nothing to do with the name. It's
all about the incorrect belief that the name itself will somehow be seen
as a marketing benefit.
You're making a lake out of a duck pond ;)
-Steve