often times you want to do more stuff in either case so ? does not always work. The if-else approach is more general.
let x: Something = {
if condition {
someSideEffect()
return foo()
} else {
anotherSideEffect()
return bar()
}
}()
But it's kind of ugly. let x: Something = if condition {
// do stuff
foo()
} else {
// do other stuff
bar()
}