I've been getting very enthusiastic about Rust recently but have been "forced" to do some Kotlin because I need an Android app and I've been finding a lot of things here that should really resonate with a Rust fan.
Great talk! but just want to clarify, 'when' expression should not always be exhaustive unless it's in a return expression. There will be just a warning instead
When I'm trying to replicate the Cancelled object inside of sealed class Result, I can't use `is` inside of the when branch val done = when (result) { is Result.Success -> showList(result.items) is Result.Failure -> result.error.printStackTrace() Result.Cancelled -> hideStuff() }
Great presentation. I enjoyed alot. But the audience is some bunch of robots with 0 humor. When Patrik try to crack a joke, audience is like (O-O). Then he explains that it is a joke. Feels bad man.
Ocaml like pattern matching and union types are very cool concept. But sealed class conditionals have terrible performance because they use javas `instanceof` under the hood.
Kotlin's `when is` -> Rust's `match` Kotlin's `sealed class` -> Rust's `enum` (or `struct` or `Either`) Now which is more ergonomic? Which is easier to write? Which is easier to develop in? I'd like to think that it's a tie but I'm leaning towards Rust for some odd reason.
There is little mystery as to why you would prefer Rust. It is what you are already familiar with. Kotlin also has the notions of enum, struct, either, etc. As far as ergonomics, expression, and ease of development, I would say this is going to be a judgement call. Personally I like the addition of the word 'is' to the switch/case mechanism, as I think this makes things more legible. I can't find myself caring too much about having to type 'sealed', because the infrequency of doing so is never going to cause me to bat an eye. But again, these sorts of things are subjective - if you like Rust's syntax better, develop the next amazing Rust application.
Thanks for the great talk!
Will be making use of sealed classes more often after this talk
I've been getting very enthusiastic about Rust recently but have been "forced" to do some Kotlin because I need an Android app and I've been finding a lot of things here that should really resonate with a Rust fan.
thank you for the amazing knowledge. Great Talk!
FYI, sealed classes are coming to Java. openjdk.java.net/jeps/360 Hopefully we'll see similar benefits in Java as discussed here.
If it's too much to type, we could always use static imports. It keeps the code clean.
Static imports work for static types ,plus static code is a big no create uncertainty in states . Ask any tester.
@@ManpreetSingh-cs5kp A good tester accounts for that uncertainty and uses mocks?
well explained ! nice talk !
Visitor Pattern Link from Patrick's Slide: th-cam.com/video/4qLj-kSOZLQ/w-d-xo.html
Nice ppt with funny stuff
Great talk! but just want to clarify, 'when' expression should not always be exhaustive unless it's in a return expression. There will be just a warning instead
Nice talk
When I'm trying to replicate the Cancelled object inside of sealed class Result, I can't use `is` inside of the when branch
val done = when (result) {
is Result.Success -> showList(result.items)
is Result.Failure -> result.error.printStackTrace()
Result.Cancelled -> hideStuff()
}
Great presentation. I enjoyed alot. But the audience is some bunch of robots with 0 humor. When Patrik try to crack a joke, audience is like (O-O). Then he explains that it is a joke. Feels bad man.
@0:07 I thought i am watching flutter conf : xD
Ocaml like pattern matching and union types are very cool concept.
But sealed class conditionals have terrible performance because they use javas `instanceof` under the hood.
It should be trivial to implement compile time plugin to generate hashed constant per sealed class and compare those instead.
12:02 I tested and it does work though
Ah Um ah um ah um ah um
Kotlin's `when is` -> Rust's `match`
Kotlin's `sealed class` -> Rust's `enum` (or `struct` or `Either`)
Now which is more ergonomic? Which is easier to write? Which is easier to develop in? I'd like to think that it's a tie but I'm leaning towards Rust for some odd reason.
There is little mystery as to why you would prefer Rust. It is what you are already familiar with. Kotlin also has the notions of enum, struct, either, etc.
As far as ergonomics, expression, and ease of development, I would say this is going to be a judgement call. Personally I like the addition of the word 'is' to the switch/case mechanism, as I think this makes things more legible. I can't find myself caring too much about having to type 'sealed', because the infrequency of doing so is never going to cause me to bat an eye. But again, these sorts of things are subjective - if you like Rust's syntax better, develop the next amazing Rust application.
to me these sealed classes look like an ugly syntax for sum types
jokes
"No need for polymorphism" - sure, object-oriented programming is dead in android, no need for this.
content is good but need a better speaker
AMAN JAIN Speaker is good but needs a better crowd.