Milan Hruban
09/17/2019, 8:09 AMPrefer using the expression form of try, if and when.
Should I apply this with no exceptions? e.g.
fun doSomething(x: Int): Int {
if (x > 10) {
<http://log.info|log.info>("an info")
someAction()
return 5
} else {
log.error("an error")
return 10
}
}
Should this be converted to return the if
expression?gildor
09/17/2019, 8:14 AMPrefer
not Must
Milan Hruban
09/17/2019, 8:19 AMgildor
09/17/2019, 8:22 AM