Chapter 1: Booleans
This is your first chapter of real code. We start with the simplest type: the boolean.
Booleans represent true/false values, just two possible values and nothing else. This simplicity is deceptive. Many problems in computer science involve boolean logic at their core, and all data in computers is ultimately represented as sequences of binary values: zeros and ones. Booleans are both the simplest data type we will use and the foundation everything else is built on.
This chapter explores booleans through five sections:
Chapter Sections
- Data and Memory: What booleans are and how we store them
- Computation: How we transform boolean values
- Control Flow: How booleans determine which code runs
- Functions: How we create our own boolean computations
- Custom Types: How we group related booleans together
We begin with Section 1 - Data and Memory: what is a boolean, and how do we hold onto one?