Paving the on-ramp

Brian Goetz brian.goetz at oracle.com
Wed Sep 28 21:23:47 UTC 2022


> The other solution is to do something similar to the compact 
> constructor of a record, a compact main that have a syntax which is 
> not currently valid in Java.

An early iteration had something like that.  I liked it for about five 
minutes!  Then I started to dislike it, because (a) it was going to 
quickly become something that needs to be unlearned and (b) it was 
spending syntax on a very narrow use case, narrow in multiple ways.  And 
fixing (a) by generalizing to "compact methods" didn't feel like a win 
either; now it was just two ways to say the same thing.

Of all the concepts that it is worth asking users to internalize early, 
I think "methods as aggregations of statements" is it.  (Yes, in this 
version you still have to confront "void" and "()".)





More information about the amber-spec-observers mailing list