Final defenders

Brian Goetz brian.goetz at oracle.com
Wed Aug 8 08:21:32 PDT 2012


> Full disclosure here: I've never programmed in Scala, just read a book a couple years ago. But the chapter about traits, and the order in which they're resolved and executed, just seemed unnecessarily complex. It's a turn-off, and we should avoid that sort of "everything under the sun, but it's very hard to grasp" approach. If that means being somewhat incremental, so be it.

We explored the linearization behavior used by Scala to resolve conflicts, and concluded it would be too foreign and "magic" for Java developers.  So instead we let developers resolve conflicts explicitly.  

> The only thing I would ask of Oracle -- and I think they're doing it already -- is to keep defaults-as-traits in the back of their heads, and design defender methods such that they can be evolved into a fuller implementation of traits in the future.

More than the back of our heads.  It's been front-and-center pretty much from the beginning.  It's just not the sole motivation of this feature, and of course we've got to respect the existing choices the language has already made, which constrains the design quite a lot.  I think its safe to say that this is not the design we'd have come up with if we started with clean paper -- but "clean paper" and "angels on the head of a pin" go together here.  


More information about the lambda-dev mailing list