Math would never be the same…
I remember learning algebra in 8th grade. It was the first time I was introduced to a variable. It was a life altering experience. Math would never be the same. Programing in many ways is like algebra. You write expressions using variables so that you can figure out the range of outcomes.
I suppose in programming, variables are more specific. In processing you have to define a variable’s datatype. It’s like saying, “I like women, but only of the blond type. I want a value, but it’s only gonna be an integer”.
Important Life Saving Note
Functions, and specifically parameters of functions are very discriminating. You can’t shove a int into a function that expects a float. This is probably one of the top mistakes, not keeping you datatypes straight. I’ll teach you how convert data types later. If only converting people to programming were as easy.
Brick by Brick, Int by Int
| Name | Size in Bits | Value Range |
|---|---|---|
| boolean | 1 | true or false |
| byte | 8 | -128 to 127 |
| char | 16 | 0 to 65535 |
| int | 32 | -2,147,483,648 to 2,147,483,647 |
| float | 32 | 3.40282347E+38 to -3.40282347E+38 |
| color | 32 | 16,777,216 colors |