Could someone help check out this <https://stackov...
# getting-started
e
d
If I understand correctly:
variable?.let { doSomething(it) } ?: doOtherThing()
But I don't think this is a good idea. It's hard to read and follow. There is nothing wrong with an if-expression.
👍 1
u
True, if one has a hammer, all problems look like nails.
(googled translation of the russian proverb) You don't have to use null safe access operator to control workflow. And never use the
?:
operator after
let
. It may broke your code if
let
returned
null
. I regularly see this question, is this case that common?