Serialization opt-in syntax (again)
andrey.breslav at jetbrains.com
Sun Oct 7 12:17:54 PDT 2012
A few thoughts:
1. Why I am against the ~> syntax.
Serialization is one of the more obscure features of Java. This makes it much more important that to make related syntax self-explanatory than for more ubiquitous features.
"~>" is about the least self-explanatory syntax we could possibly have.
2. Why I'd prefer something like (a) "() -> serializable expr" to (b) "() implements Serializable -> …"
(a) suggests that something is serializable here, as opposed to (b) that suggests that something implements java.io.Serializable. It's a huge difference.
I'd prefer lambdas eventually evolve into a relatively independent concept that would make "lambda implements interface" a leak in the abstraction.
I'd say those annotation-based options look most adequate to me.
(In the issue tracker there is some consensus of two more people about this, so I'm the third)
3. I agree with Kevin that we shouldn't say "this thing is better because now a lambda/anonymous class can implement more than one interface", because this is not really an issue.
More information about the lambda-spec-observers