Pattern Matching in Java by Venkat Subramaniam

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ค. 2024
  • We all have written our share of mundane, repetetive if-else statements that becomes hard to read, understand, and maintain. Looking at such code can take away motivation from the most enthusiastic programmers. But, you may wonder, we've had switch in Java. Sadly, the switch statement is error prone and verbose. We don't have to endure that pain anymore. The switch has evolved into an amazingly concise, elegant, and fluent expression to provide support for pattern matching. In this presentation we wil start with the problem with if-else and switch statement and walk all the way through the features of pattern matching including exploring the power of destructuring.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 3

  • @RickGladwin
    @RickGladwin 2 หลายเดือนก่อน

    I’m a simple man. I see a Venkat Subramaniam video, I click it.

  • @machindrakarpe7498
    @machindrakarpe7498 2 หลายเดือนก่อน +1

    I admire you a lot, always excited for your new videos

  • @RickGladwin
    @RickGladwin 2 หลายเดือนก่อน

    Around 52:40, the use of `sealed` without `permits` is really clean, but how/when does the compiler determine that `Sell` and `Buy` are the only two entities implementing `Trade`? Or if the compiler keeps track of everything that implements `Trade` whether `Trade` is sealed or not, does the `sealed` modifier just tell it to treat that set as complete, for the purposes of things like pattern matching?