koufa
01/05/2017, 9:04 AMas
chosen for “hard” casting and as?
for “optional” casting. I won't say that it forces me but I tend instinctively to use as
more often because it feels more “natural”, maybe because I am used to one casting option from Java . Nevertheless I would prefer Kotlin to have something in the Swift direction, that would be in Kotlin I guess as!!
. It express the fallibility more directly and is clearer to new comers and code readers as it uses the same concept as hard optional unwrapping ( !!
) that Kotlin already has.