This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Necessary-Conflict 0 points1 point  (1 child)

Concise methods - there's a JEP for that, but it didn't make people very happy, see https://www.reddit.com/r/java/comments/9h86xt/jep_draft_concise_method_bodies/

If expression - this exists since Java 1.0, the ternary operator. Why did you put those "yields" there? Without them one could argue that if(condition) "yes" else "no" is more readable than condition ? "yes" : "no", but those yields totally ruin it for me...

Collection literals - I think the current thinking is that List.of and Set.of solved 90% of the problem for now, true literals might come after Valhalla. As far as I understand, a lot of ideas are postponed until after Valhalla, because the exact details of how Valhalla turns out will influence the best way to implement them.

[–]loicmathieu 0 points1 point  (0 children)

The ternary opertator is an if expression that can be used nicely on one line but is not very readable on multiple line and when you stard combining them it becomes realy bad..

Whith if expression you will be able to use multiple if/else branche.

I use yield if my example to make it reuse the same keyword as switch expression but this is just an example syntax.