Can't help but call out Rust here for it's (imo excellent) syntax.
if condition {do_x()} else {do_y()}
Basically there's no need for line breaks between if/else, but also they decided not to add a ternary conditional operator.
if condition {do_x()} else {do_y()}
Basically there's no need for line breaks between if/else, but also they decided not to add a ternary conditional operator.
if (condition) { do_x() } else { do_y() }
That's the JavaScript version of what you wrote, and it's nearly identical. JavaScript doesn't require line breaks. const x = cond1 ? a
: cond2 ? b
: c
becomes in Rust let x = if cond1 { a }
else if cond2 { b }
else { c }