Closed
Description
The idea of banning the and
& or
keywords is really cool.
However, there is one specific case in which they may be preferred:
authenticate_user! || fail AuthenticationFailure, 'Invalid credentials'
# SyntaxError: unexpected '\n', expecting :: or '[' or '.'
authenticate_user! or fail AuthenticationFailure, 'Invalid credentials'
# (this works ok)
Of course, we we could just use
fail AuthenticationFailure, 'Invalid credentials' unless authenticate_user!
... but doesn't it degrade readability?
Is the usage of and
or or
, immediately followed by a raise
or fail
, justified?
I would be happy if you could share your thoughts!
Metadata
Metadata
Assignees
Labels
No labels