Created
June 20, 2013 11:59
-
-
Save wvdschel/5822170 to your computer and use it in GitHub Desktop.
If-cascade I saw on HN. A, B and C can be bulky expressions, such as method calls or several conditions grouped together with ||. The second example has a number of advantages:
(A) It offers a clearer split between conditions, so you don't have to squint your eyes and match parentheses.
(B) It allows you to debug with much more ease: if somethin…
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
if( A && B && C ) | |
{ | |
... | |
} | |
//=========================// | |
if( A ) | |
if( B ) | |
if( C ) | |
{ | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment