4 ms·
Unless would drive me insane. I do use IF NOT but when reading code my brain understands this format most clearly: IF some-expression ELSE Do-something
by stormdennis 4y ago
Unless would drive me insane.
I do use IF NOT but when reading code my brain understands this format most clearly:
IF some-expression
ELSE
Do-something
- shortcake27 4y ago`unless` is generally used for guard clauses (eg `return unless authorized?`) or when there’s only one branch. You don’t tend to see `unless` used with multiple branches.
- Alifatisk 4y agoThis, I’ve mostly used unless with guard clauses