More Readable Use Site extension Methods for java

Llewellyn Falco isidore at
Tue Dec 7 07:42:44 PST 2010


However, we remain opposed to use-site extension methods because we believe
> that the author of an API should remain in control of their API.  Allowing
> users to monkey-patch in new functionality to existing types undermines
> this
> demarcation of responsibility.
> (A further problem with use-site extension methods is the lack of
> reflective
> discovery.  Consumers of classfiles (such as non-Java compilers like JRuby,
> as
> well as templating mechanism such as JSP EL) cannot easily find these
> extension methods.)
Extension methods as stated ALREADY exist. the only difference is that they
can be applied after the "." which effects readability.

Let me restate this. The only argument here is READABILITY.

i have a blog about this here:

These type of methods aren't actually part of the object. It is just syntax
to allow for readability. They don't give or takeaway any power from the
"creator" of the object.

As for readability, here's an example of  the difference between the current
"reverse polish" notation enforced and the ability to write after the "."


Make sense?
Easy to read?

let's try after the "."

I believe there is a strong case that is more readable.


More information about the lambda-dev mailing list