atsushi-koshikizawa09/26/2019, 11:37 AM
Welcome to Kotlin version 1.3.50 (JRE 1.8.0_202-b08) Type :help for help, :quit for quit >>> "123".toInt() res0: <http://kotlin.Int|kotlin.Int> = 123 >>> "123".toIntOrNull() res1: <http://kotlin.Int|kotlin.Int>? = 123
wasyl09/26/2019, 12:12 PM
karelpeeters09/26/2019, 12:16 PM
"123".toIntOrNull() != null
wasyl09/26/2019, 12:18 PM
Matteo Mirk09/26/2019, 3:06 PM
napperley09/27/2019, 12:48 AM
when there are much better ways to represent default values. Strongly prefer the
option which encourages good practise, and will not cause the program to terminate. In the worst case scenario the program will crash but will continue to run, which is very important for industrial software.
karelpeeters09/27/2019, 5:39 AM
means it doesn't parse correctly, it's not like you're throwing away important exception information.