Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualStroppy Katamari

Posted 24 December 2012 - 12:27 PM

If there's one thing a beginner should be mindful of when writing conditional statements, it is to write comparisons with const value first. "if(true == a)" instead of "if(a == true)" because it prevents accidental assignment.

But when a is bool, "if(a)" is best anyway.

#1Stroppy Katamari

Posted 24 December 2012 - 12:26 PM

If there's one thing a beginner should be mindful of when writing conditional statements, it is to write comparisons with const value first. "if(true == a)" instead of "if(a == true)" because it prevents accidental assignment.<br /><br />But when a is bool, "if(a)" is best anyway.

PARTNERS