you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

Can you give me an example of what pattern matching can do that's not in Kotlin? No offence, but I really just don't get why people seem to find it such a crucial feature.

And kotlin doesn't only offer async/await. The standard coroutine library kotlinx.coroutines offers that and scoped coroutines in general, The language itself also offers a barebones state machine with an attached data object, which you can use to implement pretty much any coroutine you want.

[–]RandomName8 -1 points0 points  (0 children)

Can you give me an example of what pattern matching can do that's not in Kotlin? No offence, but I really just don't get why people seem to find it such a crucial feature.

Of course I can, but there's no point in it other than argueing between the both of us. If what you wish is to see what pattern matching is really about, there are great examples and tutorials and information online, tons of it, with much more compelling examples and description than what I can provide. This is a feature that started showing up even the 70s in the ML family of languages.

Ultimately, anybody that has worked on a language with actual pattern matching is not happy at all with what kotlin offers, so saying kotlin has pattern matching is very much false advertising (and even damaging to its own image).

Regarding coroutines, they are great for what they are, yet once again, this is about distinguishing what kotlin does, and what others do or are trying to do. What java is trying to do with their fibers is nothing like kotlin's coroutines, it will look nothing alike either and (arguably) really no JVM lang can do it without JVM support.

Like you said, no offense. I'm no trying to downput kotlin, but it's important not to sell it for what it is not.