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

  • @dcascato
    @dcascato2 жыл бұрын

    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.

  • @pmorah
    @pmorah Жыл бұрын

    Awesome presentation. What a pleasure watching venkat talks.

  • @martinschrodt5797
    @martinschrodt5797 Жыл бұрын

    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

  • @kpradeep12
    @kpradeep122 жыл бұрын

    Thank you, Venkat, it's an amazing presentation, enjoyed and learned new pattern matching in Java

  • @zaccicala2341
    @zaccicala23412 жыл бұрын

    Venkat is a great presenter. He's got a real infectious enthusiasm.

  • @DevMultitask
    @DevMultitask2 жыл бұрын

    Nice examples Venkat ! Thank you!

  • @shizhenglee4484
    @shizhenglee44842 жыл бұрын

    Can't wait to learn Java18 with Venkat!

  • @CenturionDobrius
    @CenturionDobrius2 жыл бұрын

    Ingenious mr. Venkat, the Great 😀

  • @SourabhBhat
    @SourabhBhat2 жыл бұрын

    Awesome presentation!!

  • @java

    @java

    2 жыл бұрын

    Glad you liked it!

  • @dGhost101

    @dGhost101

    2 жыл бұрын

    @@javawithout writing (javac and java in terminal) how this java compile and run in vim ??

  • @sovrinfo
    @sovrinfo2 жыл бұрын

    Thanks you a lot

  • @danieldudziak400
    @danieldudziak4002 жыл бұрын

    How pattern matching is going to handle dynamic code and scenarios that can occurs with OSGi?

  • @luigibuoncristiani2681
    @luigibuoncristiani2681 Жыл бұрын

    It is very interesting and push to have more elegance in coding. Perhaps it missing something on generic types.

  • @badpotato
    @badpotato2 жыл бұрын

    can you ask Venkat to use some IDE which uses syntax highlighting.. this will make code reading a lot better.. Presentation is really good.

  • @PandaMoniumHUN
    @PandaMoniumHUN2 жыл бұрын

    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

    @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.

  • @MrMikomi
    @MrMikomi Жыл бұрын

    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.

  • @avalagum7957
    @avalagum79572 жыл бұрын

    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

    @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

    @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.

Келесі