Default method survey results
Alex Blewitt
alex.blewitt at gmail.com
Thu Aug 16 02:13:33 PDT 2012
On 16 Aug 2012, at 09:43, maurizio cimadamore wrote:
> The fact that
> implementations will start to appear in interface is potentially
> confusing to those developers, and we think that the use of a keyword
> (which, btw, reflect the semantics pretty well, as described above),
> will help developers to understand more quickly things
The point of confusion - where the method is coming from - is at use site of the interface, not declaration site. What keywords you use at the declaration site (probably written by someone else) will make absolutely no difference to the person who implements that interface, keyword or not.
All that will happen, several years from now, is that people will repeatedly ask on StackOverflow* "Why do we have to use this default keyword when it's obvious" and will not assist at all in understanding. It's just syntactic cruft.
And then, in Java 19, we'll have the removal of the default keyword with a JSR proposal to replace it with an 'effectively default' operation, in the same way that we are getting rid of 'effectively final' now.
Alex
* And then I'll be able to link back from StackOverflow to this mail thread and say "Here's where it went wrong"
More information about the lambda-dev
mailing list