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

Reply via email to