Рет қаралды 546
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.