What the Boolean?

What is Boolean? – a soup ingredient? gold? Nope. Turns out it’s basically the foundations of computer science.

I noticed the Boolean term has come up in a few of our readings and most noticeably as a variable in Flash, so I decided to do some investigating and try to figure out what the heck Boolean means.

First, meet George Boole. In the 1850s, this English mathematician and philosopher was writing about the fundamental logic now used for computers long before the technology was even available.

Boolean logic is basically the concept of True and False (otherwise represented as 1 and 0, on and off). From what I have been able to deduce, a computer system can compute complicated functions with just the idea of true or false. With the simple qualifiers (called gates) of AND, OR, NOT – a computer can compute anything. For example:

If False AND False = False
If False AND True = False
If True AND True = True

If False OR False = False
If False OR True = True
If True OR True = True

If False NOT = True
If True NOT = False

Huh? I felt the same way, but the genius is in the simplicity. “= True” or “= False” determines what function occurs. By simply combining AND, OR, and NOT gates, it gives an almost infinite # of possibilities.

For Flash we don’t really need to understand the intricacies of Boolean logic, however it does help with using the Flash variable. In Flash terms it represented this way:

var name:Boolean=false;

function name(e:Event):void {

if(name) //so if false as defined above// {
do x}
else //so if opposite of above, so if true// { do y}
}

So Flash Boolean isn’t worrying about the combination of multiple trues and falses for a single object. It is just assigning an object a value (true or false), and then letting you give it functions based on what state that object is in (true or false). Thereby giving you more flexibility when controlling the functions of that object

So that’s a brief introduction to Boolean – I hope it makes sense, and maybe helps you understand why we are using it in Flash.

(Information was gathered from various sources and this post was intended for an non-CS audience, so apologizes for my attempts to simplify these complex ideas: like this one and this one.)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s