Stupid little iota of an idea

Olivier Pisano olivier.pisano at laposte.net
Sat Feb 12 01:36:43 PST 2011


Le 12/02/11 01:55, bearophile a écrit :
> Andrei:
>
>> Not all users dislike iota,
>
> A poll will tell how much this statement is true :-)
>
>
>> and besides arguments ad populum are fallacious.
>
> That's true for scientific and engineering (or medical, etc) things but names are not a science. The process of choosing names is part of ergonomics, it must deal with what people, with what they find closer to their mind, culture, brain. Python developers discuss carefully about naming, and indeed, Python names are sometimes better than Phobos ones. One of the problems here is that the mind of every person, you, me, Walter's has "quirks", that is mind processes not shared by most other people. So if a single person chooses names, those quirks come out, and the names are uniform (because they are chosen using the same strategy, and this is positive), but sometimes they also reflect those quirks. The only way I know to avoid this problem is to design names using polls :-)
>

I fully agree with you Bearophile.

>
>> Iota rocks. But have at it - vote away, and I'll be glad if
>> a better name for iota comes about.
>
> I am not going to invent a new wonderful name for it, sorry :-) My votes, in decreasing order of preference:
> 1) By far, a syntax like a..b:c, or missing that, a syntax like a..b
> 2) If first class interval syntax is really not possible, then my second choice is a function named "range". This is what Python uses, it's natural, short enough, and good.
> 3) If you refuse the word "range", then my third choice is "interval". It's as cleas as range, but it's a bit worse because it's longer.
> 4) My fourth choice is "iota". It's short and it sticks in mind.
>

I am certainly not a regular poster here, so my opinion is likely to be 
less taken into account, but as a simple D user whose primary language 
is not English, here is my humble contribution (FWIW) :

1) I'd like to have the a..b syntax.
2) I think I like "interval" the most. It is certainly longer than iota 
to write, but as code is certainly much more read than written, I think 
it is an acceptable tradeoff. I guess Phobos does already functions with 
names longer than 7 chars, doesn't it ?

If you take Andrei's example :

   filter!`a % 2 == 0`(iota(1, 5))

and

   filter!`a % 2 == 0`(interval(1, 5))

I believe the second is likely to be more informative in terms of what 
the function does to a newcoming user. Interval comes from latin and 
latin-derived languages are quite widespread around the world.

According to Google :
Spanish: intervalo
Portugese: intervalo
French: intervalle
Italian: intervallo
Romanian: interval

BTW, musical theory does use the same vocabulary (intervals and steps), 
it is certainly not a valid argument, but as music one of the most 
universal thing on this earth, I find it amusing.

3) I don't think "range" should be used here. I love it in Python, but 
Range does refer to a more generic concept in D. Using range as a 
function name could add some confusion.

4) I believe a function name should tell what it does. An alphabet 
letter (greek or not) is a poor indication and should be avoided. "sum" 
is a more reasonable choice than "epsilon", even if that what we all 
write in math.

My two cents,

Olivier


More information about the Digitalmars-d mailing list