break seen as a C archaism

Brian Goetz brian.goetz at
Mon Mar 12 19:38:15 UTC 2018

> Most problematic for me is that everywhere in Java block syntax (curly 
> braces) is used to switch (no pun intendent) between single expression 
> / statement and multiple statement variant. But for switch expressions 
> colon and arrow is used instead... This seems verry irritating seens 
> whole language managed to use block syntax everywhere else before...

But, the whole point is, we *didn't* use block syntax everywhere before 
-- specifically not in switch.  The treatment of blocks in switch has 
always been an irregularity.  And the proposal about switch is in 
keeping with how switch has always worked.

Is this the only way we could play it?  Surely not.  We could try to 
"fix" switch -- as many have suggested we do.  And doing so will create 
obvious seams.  We could make a new construct, "match", that is like 
switch, but not.  Then we'll have two similar, but different, ways to do 
the same thing.  So my preference has been, to the extent was can extend 
switch in a manner consistent with its heritage, let's do that.

Would we do this if were designing a new language from scratch?  Of 
course not.  But that's not what we're doing here.

More information about the amber-spec-observers mailing list