Saturday, November 13, 2010

Temporary Variables

An excellent example of how to use temporary variables:

bool add = false;
// .. some lines of code 
if (hasPrivilege(Update)) {
  add = true;
}
if (add) {
  Add(Share);
  Add(Cover);
  Add(Locations);
  Add(Count);
  Add(Source);
  Add(Comment);
}

No comments:

Post a Comment