In ruby case statements feel less verbose, less prone to error since the intention is to validate a single statement against multiple outcomes and is more human readable.
With linting case statements are one way to still have compact code.
Everything has its utility.
if status == :active { '/active'} elsif status == :incomplete { '/incomplete'} elsif status == :suspended { '/suspended'} end case status when :active then '/active' when :incomplete then '/incomplete' when :suspended then '/suspended' end
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In ruby case statements feel less verbose, less prone to error since the intention is to validate a single statement against multiple outcomes and is more human readable.
With linting case statements are one way to still have compact code.
Everything has its utility.