Skip to content

Instantly share code, notes, and snippets.

@wvdschel
Created June 20, 2013 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvdschel/5822170 to your computer and use it in GitHub Desktop.
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…
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