Function type naming conventions
Doug Lea
dl at cs.oswego.edu
Fri Jan 11 09:37:31 PST 2013
On 01/11/13 12:28, Dan Smith wrote:
>>> IntValFunction<T> // T -> int
>>>
>>> The meaning should be unambiguous.
>>
>> Only if you mentally associate "val" with the result :-)
>
> What I'm hoping to contribute is that, beyond just "I like the way
> IntValFunction sounds," the established mathematical terminology IS
> "integer-valued function." If we can express that concisely, then the name
> says exactly what the type means, without having to invent a new term or fall
> back to the more verbose "function from integer to object."
>
I'm really not trying to be hostile about this, but just noting that
the programmer impact of these suggestions relies on common
shared conventions/intuitions, but since there currently are none
in Java, clarity seems to be the primary goal.
(As evidence, consider discussions of method "fun1.compose(fun2)".
Which way does it go? Probably best to have no method just
named compose.)
-Doug
More information about the lambda-libs-spec-experts
mailing list