Let's first talk about booleans, which you might already know, so I apologize if this is review. If you think you understand booleans completely, skip this puppy.
A boolean is a variable type in many programming languages. It usually that something can be true or false, yes or no, on or off, 0 or 1.
I imagine booleans like lightswitches. They can either be on or off -- true or false.
Most languages have true
and false
, but they vary somewhat. C++ writes true
and false
, where Python has capitalized True
and False
. CoffeeScript supplements the classics and adds yes
, no
, on
, and off
. C kinda doesn't have them built-in, you have to make your own.