2 ms·
Calling Optional.map(foo -> foo.bar) is effectively equivalent to foo?.bar in Kotlin. What GP was saying is that the author is using things like parseInt and ot
by kodablah 8y ago
Calling Optional.map(foo -> foo.bar) is effectively equivalent to foo?.bar in Kotlin. What GP was saying is that the author is using things like parseInt and other non-idiomatic things because the author is not familiar enough with the language. Even if it weren't about parseInt vs toInt, the author could have used "number?.let(Integer::parseInt)" instead of "number?.let { Integer.parseInt(it) }" (but of course "number?.toInt()" is the idiomatic way to convert a nullable string to a nullable int).
- johnwick17 8y agoNow that I look at the article, it occurred to me that author might have already been biased when trying Kotlin out and was already certain about the outcome hence the rather poor argumentation. The article itself is rather poorly organized and chaotic as well.