Quote:
Originally Posted by xXziroXx
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.
|
In many cases 1 is true and 0 is false. More specifically, 1 is known as "on" and 0 is known as "off". Computers only recognize one main function, and that's whether or not there's electricity flowing. It converts this fast-paced data in form of binary which is the most basic step of humanizing the machine.
0 is 0
1 is 1
10 is 2
11 is 3
etc.
This information is then utilized accordingly to perform specific actions.