Profile cover photo
Profile photo
Cay Horstmann
1,689 followers -
In my copious spare time, I write about programming languages and computer science education.
In my copious spare time, I write about programming languages and computer science education.

1,689 followers
About
Posts

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Post has attachment

Post has attachment
A few days ago I happened to notice that Project Amber is busy working on the syntax and semantics of switch expressions. You can write something like:

int numLetters = switch (day) {
case MONDAY, FRIDAY, SUNDAY -> 6;
case TUESDAY -> 7;
case THURSDAY, SATURDAY -> 8;
case WEDNESDAY: logger.info("It's Wednesday"); break 9;
};

I was all on board until I saw "break 9".

I mean, I write books and teach courses, and I actually have some idea what is difficult for readers and students. The switch statement is a dumpster fire, and break is no picnic either. Adding a new wrinkle to break seems like a really poor idea.

Not being a member of the spec group, I posted on the dev group and was sternly admonished to stop the bikeshedding.

I wrote up a short article at http://horstmann.com/unblog/2018-04-23/index.html and invite all bikeshedders to join the discussion.
Add a comment...

Post has attachment
Add a comment...
Wait while more posts are being loaded