Populating Boolean variables


Link to this posting

Postby Ursego » 21 Feb 2013, 22:07

If it's possible, populate Boolean variables with results of Boolean expressions instead of direct assigning of true and false.

*** BAD code: ***

Code: Select all
if (rowCount > 1)
   multiRowsMode = true;
else
   multiRowsMode = false;

*** GOOD code: ***

Code: Select all
multiRowsMode = (rowCount > 1);
User avatar
Ursego
Site Admin
 
Posts: 128
Joined: 19 Feb 2013, 20:33



IF you want to ((lose weight) OR (have unbelievable (brain function AND mental clarity))) THEN click:




cron
free counters

eXTReMe Tracker