Thread: Snake
View Single Post
  #12  
Old 04-04-2009, 09:25 AM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by xXziroXx View Post
You're saying that you prefer using magic numbers instead of true booleans? Using true/false is a widely accepted convention in computer science.


Extraneous information:

There's no real reason why 0 is false and 1 is true. It just happened; that's why it's good practice to use true/false. Apart from better communicating your intention, Stefan might go mad and change the engine so that the number 7 is true and number 3 is false.

You are right, there is no reason why I couldn't say 1000 and 5000 are true and false instead, it is just easier for me to say 1 is on and 0 is off then it is to say true is on and false is off. That is the way I learned it. I will admit that true/false makes more sense then 1/0 (because if you are using an integer it could conceivably be set to not 1 or 0,) but what is familiar will always hold true to the programmer.
__________________
Reply With Quote