Remix.run Logo
▲ userbinator 2 hours ago

I would actually prefer chained ternaries over more verbose if/else expressions with duplicated LHS, so this does go back to the argument about "taste".

▲AlienRobot an hour ago | parent [-]

This is one of the things I like about Rust. You can have both.

    let foo = {
        if bar {
            1
        } else if baz {
            2
        } else {
            3
        }
    };
Unfortunately not all languages are Rust.
▲userbinator an hour ago | parent [-]

That isn't more concise than

   foo = bar ? 1
             : baz ? 2
                   : 3;
▲AlienRobot 43 minutes ago | parent [-]

But it's more readable, and that's what matters.