Function parameter order (original) (raw)

David Holmes david.holmes at oracle.com
Tue Nov 6 19:19:11 PST 2012


On 7/11/2012 2:58 AM, Kevin Bourrillion wrote:

It sounds as though we're planning on Function<ReturnType, InputType>.

Yes. This was indicated, somewhat subtly in my view, in the review request:

I don't have a general preference other than maintaining consistency and given that we have Map<K,V> it seems to me that we have a long standing precedent to have the return type last not first.

David

I'd just like to note that this is going to put codebases that are in any stage of migration to JDK types from existing libraries including Guava in a really, really bad position.

Every time I see Function<A, B> for /years/, I am going to have to check the imports to find out whether that's A->B or B-A. I'm not saying this consideration should trump all others. Just noting that I see this as a very bad problem for my user base. -- Kevin Bourrillion | Java Librarian | Google, Inc. |kevinb at google.com <mailto:kevinb at google.com>



More information about the lambda-libs-spec-observers mailing list