The Elegance of Pattern Matching in Modern Java
Ғылым және технология
JavaOne is back! ➱ oracle.com/javaone
This presentation will examine the evolution of switch from a statement to an expression and on to powerful pattern-matching machinery in modern Java. You'll also explore the reasons to refactor code to use this elegant and concise feature.
Presented by Venkat Subramaniam - Founder, Agile Develper, Inc.
⎯⎯⎯⎯⎯⎯ More information ⎯⎯⎯⎯⎯⎯
◦ Agile Developer Inc. ➱ www.agiledeveloper.com/
◦ Dev.java, The Destination for Java Developers ➱ dev.java/
◦ Inside Java, News and views from members of the Java team at Oracle ➱ inside.java
◦ OpenJDK ➱ openjdk.java.net/
◦ Oracle Java ➱ www.oracle.com/java/
Tags: #Java #OracleDevLive #Java18 #JDK18 #OpenJDK
Пікірлер: 21
So exciting to see the Java evolution! And as Venkat mentions in the end, imagine having things like destructuring in Java, dear lord, just can't wait to see it.
Awesome presentation. What a pleasure watching venkat talks.
I was waiting for several minutes for you to spot the superfluous "r" in "interger", and was very happy when you finally removed it. Just for you to undo 20 seconds later and put it back in again :D
Thank you, Venkat, it's an amazing presentation, enjoyed and learned new pattern matching in Java
Venkat is a great presenter. He's got a real infectious enthusiasm.
Nice examples Venkat ! Thank you!
Can't wait to learn Java18 with Venkat!
Ingenious mr. Venkat, the Great 😀
Awesome presentation!!
@java
2 жыл бұрын
Glad you liked it!
@dGhost101
2 жыл бұрын
@@javawithout writing (javac and java in terminal) how this java compile and run in vim ??
Thanks you a lot
How pattern matching is going to handle dynamic code and scenarios that can occurs with OSGi?
It is very interesting and push to have more elegance in coding. Perhaps it missing something on generic types.
can you ask Venkat to use some IDE which uses syntax highlighting.. this will make code reading a lot better.. Presentation is really good.
Nice presentation. However, you should be aware most of the examples presented here violate Liskov substition principle. I hope I'll never see switch cases differentiating between interface implementations.
@edmaphis9805
2 жыл бұрын
If project Amber is successful, you'll see switch expressions differentiating on sealed (closed) interfaces everywhere. That's how Java will implement union types.
I do not understand why Venkat encourages us not to use default when an unexpected value is received. I always throw an IllegalArgumentException. That behaviour is future proof.
Dr Subramaniam might not do Scala any more, but I guess he will admit that Scala's pattern matching is the best and although Java's pattern matching is nice, it's like a joke compared to the Scala one.
@edmaphis9805
2 жыл бұрын
Java pattern matching isn't complete. They will add features to it incrementally over time. Decomposition of classes and records is coming next.
@avalagum7957
2 жыл бұрын
@@edmaphis9805 that's right. I hope it won't take Java 3 years to have features that Scala had 3 years ago. I also hope the project Loom will be finished soon so that all jvm languages can benefit from.