I think more languages should have `unless`. I have seen lots of code like `if !(this || that)` that would be easier to read with `unless`. Sometimes `if !this && !this` is clear enough but I frequently find that I am decided between two mediocre options. I think the clarity of `unless`outweighs the benefit of another keyword, especially when it is so similar to `if`.


@kevincox switch / case / default pattern, and discrete tests for 'this' and 'that' ending with else or explicit goto, make a natural place for the code to flow to if none already matched.

Sign in to participate in the conversation

Hello! mas.to is a general-topic instance. We're enthusiastic about Mastodon and aim to run a fast, up-to-date and fun Mastodon instance.