[jsr-335-eg] Default method survey results

Brian Goetz brian.goetz at oracle.com
Sun Oct 21 07:03:26 PDT 2012

>> And one obvious one we forgot (which was the one we started with!):
>>   extension void foo() { … }
> It think this one is very misleading. Those who knew the term before, would think this is not what it actually is.
> Those who didn't know the term before will be OK until they come across the same word in the different context.
> Let's avoid this confusion.

I get your point, but just because C# happened to come up with something 
they decided to call extension methods a few years ago, doesn't mean 
that extension methods must be inherently use-site or static or 
otherwise like C#'s interpretation.  The core concept of after-the-fact 
extension is what counts; the mechanism (monkey-patching vs accretion) 
and the specific characteristics (static vs virtual) differ, but these 
are details -- if C# had virtual extension methods, they still would 
probably call them extension methods.

> It is almost as bad as saying that Java 8 has traits.

Fortress had stateless traits; these were just as much real traits as 
Scala's stateful traits.  People who know one language don't notice; 
people who know more are used to the same concept (e.g., class) meaning 
slightly different things in different languages.

Other opinions?  For all its faults, is "default" better than "extension"?

More information about the lambda-spec-experts mailing list