February 12, 2011
On Saturday 12 February 2011 03:25:29 Andrei Alexandrescu wrote:
> On 2/12/11 5:02 AM, bearophile wrote:
> > Jonathan M Davis:
> >> interval is slightly better, but as you mention, the step value muddles that abstraction.
> > 
> > It's not muddled enough to make it worse than iota(). "iota" has nearly no relation with its purpose in Phobos.
> 
> And that's part of what makes it best.

Agreed.

- Jonathan M Davis
February 12, 2011
On 02/12/2011 02:36 PM, Jonathan M Davis wrote:
> With something like walk
> or interval, the name gives you a better idea of what it does, but it's _still_
> not good enough for you to know based on the name and, since they mean something
> closer to what the function actually does but not quite, they risk misleading
> you as to what the function does.

This is partially true. But think at this: every name can only be polysemic, by the very nature of languages, I mean all languages used by humans. Then, in context, especially more formal ones like PLs, they have a chance to take a better defined sense.
The whole problem is to try and compose a lexicon, a set of names, that is clear, consistent, organised, in such a way that every single name can (at least have a chance to) evoke its actual semantics. And not be misleading or ambiguous. Which is hard when the language evolves.

Following your statement above, then *all* names in *all* programming languages are wrong. None of them perfectly means, as a word, what in means in the language; even less for all programmers. The only solution to comply with your request is to apply the procedure I posted earlier, namely random generation + filter on "bad strikes" (names that by chance still evoke their sense). 'iota' is not even even good in this respect since it is not free of any cognitice connexion to its actual meaning (--> at least 2 of us thought it means a single (minuscule) step).

Conversely, names more or less, or not really, "good enough" in pure abstraction, like "interval", can be very good /in context/:

	filter!`a%2==1`(interval(1,10));

Do you have any problem in interpreting this? (Without prior knowledge of D arcanes, I certainly have an unsolvable problem in interpreting the part between "filter" and the parens; both `...` and '!', in fact.)
Now, replace with iota and imagine what programmers think/guess when reading the D version online...
(*)

Denis

(*) Alternatives I would love:

	filter(interval(1,10), {n : n%2==1});
	filter(1..10, {n : n%2==1});

I bet it is close to impossible for a programmer, whatever their background, to not understand those versions /at once/ --provided they know the signs '%' and '==', and that intervals are supposed to be right-open.
-- 
_________________
vita es estrany
spir.wikidot.com

February 12, 2011
Jonathan M Davis:

> On Saturday 12 February 2011 03:25:29 Andrei Alexandrescu wrote:
> > And that's part of what makes it best.
> 
> Agreed.

If you agree on that, then you can't be a designer for a public API.

Bye,
bearophile
February 12, 2011
Nonsense is the part of what makes it best? This one goes in my favorite quotes bin.
February 12, 2011
On Saturday 12 February 2011 06:21:15 bearophile wrote:
> Jonathan M Davis:
> > On Saturday 12 February 2011 03:25:29 Andrei Alexandrescu wrote:
> > > And that's part of what makes it best.
> > 
> > Agreed.
> 
> If you agree on that, then you can't be a designer for a public API.

I'm not saying that you should typically pick function names that way. But given that we already have iota, have already had iota for some time, and that there is already a C++ function by the same name that does the same thing, I see no reason to change it. It's nice and memorable, and it doesn't create confusion based on misunderstanding its name. Sure, a name that clearly says what it does would be nice, but I don't really like any of the names that have been suggested, and iota has worked just fine thus far.

I'm not suggesting that we go and name functions sigma and gamma or xyzzy or whatnot just because they mean nothing and are memorable. I'm saying that because we already have a function name which is memorable, I see no reason to exchange for one less memorable just because the name is nonsensical. It's useful in well-used functions to have short, memorable names, and iota fits that to a t.

- Jonathan M Davis
February 12, 2011
On 2/12/11 6:52 AM, spir wrote:
> On 02/12/2011 12:25 PM, Andrei Alexandrescu wrote:
>> On 2/12/11 5:02 AM, bearophile wrote:
>>> Jonathan M Davis:
>>>
>>>> interval is slightly better, but as you mention, the step value
>>>> muddles that
>>>> abstraction.
>>>
>>> It's not muddled enough to make it worse than iota(). "iota" has
>>> nearly no
>>> relation with its purpose in Phobos.
>>
>> And that's part of what makes it best.
>
> What about a random name generator to define a language.stdlib's
> lexicon? Then run a post-filter fed by user complaints about given names
> actually suggesting some relation to any [part|aspect] of their sense.
>
> denis

What I meant was that "iota" is not confusable with other concepts in Phobos, while at the same time being evocative for the task at hand. Another evocative term would be "quanta", but somehow I suspect that will enjoy little traction. :o)

Andrei
February 12, 2011
On 2/12/11 8:40 AM, Andrej Mitrovic wrote:
> Nonsense is the part of what makes it best? This one goes in my
> favorite quotes bin.

Better put it in that bin with quotes taken out of context.

Andrei
February 12, 2011
On 2/12/11 8:21 AM, bearophile wrote:
> Jonathan M Davis:
>
>> On Saturday 12 February 2011 03:25:29 Andrei Alexandrescu wrote:
>>> And that's part of what makes it best.
>>
>> Agreed.
>
> If you agree on that, then you can't be a designer for a public API.

Oops. Someone stop the release of 2.052 NOW! :o)

Andrei
February 12, 2011
On Saturday 12 February 2011 07:34:43 Andrei Alexandrescu wrote:
> On 2/12/11 8:21 AM, bearophile wrote:
> > Jonathan M Davis:
> >> On Saturday 12 February 2011 03:25:29 Andrei Alexandrescu wrote:
> >>> And that's part of what makes it best.
> >> 
> >> Agreed.
> > 
> > If you agree on that, then you can't be a designer for a public API.
> 
> Oops. Someone stop the release of 2.052 NOW! :o)

LOL. It would be true that I have now named a rather large portion of the functions in Phobos now thanks to std.datetime. However, those tend to have very descriptive names. They also tended to be functions which were relatively easy to name.

Honestly, I never would have named iota iota. It isn't descriptive at all. But given that we already _have_ the name and there is a precedent for it, I see no reason to change it. It's short and memorable, and you're not going to misunderstand what it means based on its name.

So, no I wouldn't have chosen iota if I were naming it, but I don't think that it's worth breaking code for now. Since we have it, I say take advantage of the fact that it's short and memorable and just leave it.

- Jonathan M Davis
February 12, 2011
Jonathan M Davis wrote:
> On Saturday 12 February 2011 02:33:12 Jeff Nowakowski wrote:
>> On 02/11/2011 11:14 PM, Jonathan M Davis wrote:
>>> If anyone tried to use iota to actually mean something as a variable or function name, I'd be suggesting that they pick a better nam.
>> So you're saying you don't like Andrei's chosen name? ;)
> 
> No. Andrei isn't trying to use the word based on its actual meaning. As it stands, the name is essentially nonsensical. That means that it's a vey poor name from the standpoint of figuring out what the function does based on its name.
> 
> _However_, precisely because it's such a short and nonsensical name, it's really easy to remember. I'm fine with keeping it as is. If someone could come up with a perfect replacement, then that woludn't be too bad, but honestly, I think that most of the names suggested actually increase the confusion.
> 
> With iota, you don't have a clue what it does based on its name, so you look it up. Then you remember it, because it's very memborable. With something like walk or interval, the name gives you a better idea of what it does, but it's _still_ not good enough for you to know based on the name and, since they mean something closer to what the function actually does but not quite, they risk misleading you as to what the function does. At least with iota, you know that you're going to have to look it up.
> 
> There's already precedent for iota as Andrei has stated, and it's been in std.algorithm for a while, so I'm fine with leaving it as is. It's a highly memborable name, and it's nice and short to boot.
> 
	The problem is that “iota” *does* make sense, but it is used in a
way quite different from its meaning. So when you see it you do not
look it up, but instead assume that you know what it means and do
not understand how the code you are looking at works.

		Jerome
-- 
mailto:jeberger@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr