-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
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
d368646
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, why avoid
unless
?d368646
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just personal style. I honestly think that
unless
is clearer in some cases (perhaps including this), but the line becomes blurry very quickly:else
unless foo && bar
unless not_foo
if
expressions fall under the same problems, but as programmers we're generally trained to understandif
rather intuitively, so I tend to avoid the potentialunless
mess in the future by using onlyif
statements.I'm not religious about it except in my own code, and I won't argue with someone about it (its just not that important), but I do my best to only use
if
s.