but then maybe my ideal world would have `foo: Str...
# announcements
k
but then maybe my ideal world would have
foo: String
and
foo: mut String
, and no
val
and
var
😛
r
So... Rust? 😉
k
I think Rust got a ton of stuff right. Mutability for sure.
val
and
var
are okay, but the equal lengths means that you're still making a choice every time you declare a variable. IMO all variables should be immutable, and you should only have to make a choice when you choose to make it mutable. And it should be considerably less nice-looking to make a variable mutable so that the intentions are clear 😛 Rust also has interior immutability, which is a huge win IMO, and something that was very well-received during the Kotlin feature request survey, but I don't know if we could ever have that realistically
r
I agree that Rust has tons of things right, but I think many of its immutability guarantees would be impossible to implement on the JVM.
k
yup