4 ms·
The new style of switch statements is very nice. I've found myself using if else blocks to replace switch statements because they're simply more legible, and th
by lemagedurage 7y ago
The new style of switch statements is very nice. I've found myself using if else blocks to replace switch statements because they're simply more legible, and they take up less vertical space. Now the new style switch statements will be an improvement over that.
- aliakhtar 7y agoIts copied from Scala pattern matching, and still isn't as good as it.
- pron 7y agoAlmost all features in the Java language are guaranteed to be copied from other languages because it is in Java's "charter" not to introduce features that haven't been tried in other languages first, and then copy only those that have shown a good cost/benefit. The question you should ask is not which features are copied, but which ones aren't.
- mateuszf 7y agoIt's not copied from Scala, there were many languages before Scala which had this feature before.