In particular, to his:
> Where does this absolutely crazy confidence of a compiler that each character of my program is an element of multithread concurrency come from?
I'd reply: why would the compiler have this absolutely crazy confidence that a particular character of your program isn't an element of a multithread concurrency? Why do you want your compiler to make assumptions about your code if it's not able to enforce them?
I don't know what's the right way to write what he means in Kotlin but in Rust it'd be something like:
match (value) {
Some(v) => v,
None => 0
}
Or alternatively: value.unwrap_or(0)
Which are both safe and, in my opinion, clearer than the proposed code in TFA. I would assume that Kotlin has a similar syntax for that use case?That being said I can imagine that having to interface with Java (which doesn't share the same "mindset") might be frustrating. It helps when all the language and its libraries are designed from the ground up around a certain paradigm.