Thread: formatting
View Single Post
Old 04-02-2003, 05:41 AM   #29 (permalink)
jeffro
Person of interest
 
jeffro's Avatar
 
Join Date: Mar 2003
Location: New Jersey
Posts: 102
jeffro is on a distinguished road
This may just be me but I only use brackets when I have more than one command or statement in an if block. Travis' style is correct but, if there are only 2 outcomes for the if block (true|false). If that is the case, why not just use this style?
Code:
(condition) ? true : false;
Other wise I have to use brackets to surround my statement.
Code:
if (var == 0 ) 
{
  //adsf
  //asdf
} else {
  //;lkj
  //;lkj
}
jeffro
__________________
Jeffro
Linux counter#:213782
GnuPG ID: 406238E7
jeffro is offline   Reply With Quote