Stupid little iota of an idea

spir denis.spir at gmail.com
Thu Feb 10 03:40:51 PST 2011


On 02/09/2011 09:08 PM, Ary Manzana wrote:
> On 2/9/11 3:54 PM, bearophile wrote:
>> - There is no need to learn to use a function with a weird syntax like iota,
>> coming from APL. This makes Phobos and learning D a bit simpler.
>
> I would recommend stop using "weird" names for functions. Sorry if this sounds
> a little harsh but the only reason I see this function is called "iota" is to
> demonstrate knowledge (or to sound cool). But programmers using a language
> don't care about whether the other programmer demonstrates knowledge behind a
> function name, they just want to get things done, fast.
>
> I mean, if I want to create a range of numbers I would search "range". "iota"
> will never, ever come to my mind. D has to be more open to public, not only to
> people who programmed in APL, Go or are mathematics freaks. Guess how a range
> is called in Ruby? That's right, Range.
>
> Another example: retro. The documentation says "iterates a bidirectional name
> backwards". Hm, where does "retro" appear in that text? If I want to iterate it
> backwards, or to reverse the order, the first thing I would write is
> reverse(range) or backwards(range), "retro" would never come to my mind.

I completely share your points, here.
About iota, while I cannot speak for the English language, in mine (Fr) iota 
means more or less <a tiny, irrelevant, difference>, typically used as "it 
hasn't (even) changed a iota". I can hardly make any connexion with the sense 
of range/interval. No idea why APL designers used this name, but for sure we 
should not reproduce their error.
Retro is far less problematic because at least the sense matches ;-) But I 
agree an unexpected name is a drawback even if semantically correct: I just 
spent some time searching for "reverse" precisely; I knew they func exists but...

The problems is worse in Phobos, because functionality is split across 
moduleaccording to a non-obvious scheme (if any) (?). In any other language, 
searching for a func operating of foos, you'd just explore the foo module, 
right? In Phobos, you need to explore foo, functional, algorithm, bar & baz, 
and whatnot. Plus possibly some modules outside std properly speaking (core, C 
libs). Very annoying. The logic should be obvious, and at best what most 
programmers would expect.

> (and no, replies like "you can always alias xxx" are not accepted :-P)

Certainly, because it's /highly/ important for a community of programmers to 
share the same "culture". And names are the main support & vehicle for this 
culture.

Denis

(For this reason, I stoppped aliasing size_t and size_diff_t to Ordinal and 
Cardinal ;-) I use uint everywhere)

-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list