Created
April 28, 2012 20:39
-
-
Save stormbrew/2521852 to your computer and use it in GitHub Desktop.
Devil's advocate argument for case based on its term-less form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ugly poorly aligned if | |
if a == b | |
elsif b == c | |
elsif z == d | |
else | |
end | |
# nicely aligned case | |
case | |
when a == b | |
when b == c | |
when z == d | |
else | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment