Post

Switch expressions and more-so ternaries inside string interpolation always make me feel weird. Weird enough to allocate vars above them. Especially if throwing an exception is involved.

Agree it's weird, but if you're guaranteed to only need the result for that single string it might be alright. I'm not fully sure how I feel about it yet as I haven't seen it in the wild that often 🤔

That is ridiculous. Don't get me wrong, I really like the “switch expressions” language feature, but the example shown goes a bit too far for me. It goes against everything I care about in terms of readability and maintainability.

Not sure how I feel about this. It took too long to work out what it was doing. A separate var would aid with readability and hence maintainability imho

I'm not sure I can answer that in a public setting! 😂 Honestly though, the syntax highlighting makes it look not very much different from doing it separately.

That's an interesting take, but this is the only place that the Asset Type would ever be converted to a string - does that change your mind?