Before I start actually explaining everything, how things work, syntax, etc., READ THE AUTHOR'S NOTES. I know for a fact that the majority of the people who picked up this book will not read the author's notes. I personally have skipped it before while reading other books, but this paragraph is here to tell you to not skip it. It has valuable information inside of it that will help you understand everything that is going on inside of this book. So stop reading chapter 1 and start reading the Author's Notes, which includes the Prologue.
Now some of you might have skipped the first paragraph, thinking you can skim through this book. This paragraph's existence is to show you that this book cannot be skimmed through. Every paragraph, sentence, and word is put in this book for a reason. If I wanted to create a book where it had filler places within it to take up someone's time, I would have written the alphabet over and over. But no, I have not done that, so read the first paragraph, and read the Author's Notes. Don't let me catch you slipping up again.
Computers.
Computers are simpler than anyone really knows or thinks (unless you already know this piece of information). All computers are is a series of ones and zeroes. Each zero or one represents an on or off switch. This is called binary. That's it. Programming languages manipulate these ones and zeroes to control the behavior of the machine. Or if you prefer simpler terms, programming languages make these ones and zeroes turn off and on en masse to perform a task.
Programming languages are all about manipulating these ones and zeroes. These languages have gotten so big, complex, and layered, that they make up the common operating systems that people use today, like Windows, Mac OS, or Linux. It's not limited to straight PC's either. Phones use operating systems too, like iOS and Android. To start, binary is the simplest "language" that exists and is the basis of every single computer on the planet (this includes calculators and phones, and any other electronic item). Then comes other languages that sort these ones and zeroes quickly to do specific tasks. Operating systems are just layers upon layers of languages and programs designed to move, change, and rearrange these ones and zeroes.
You might have heard the common terms "Kilobyte" (KB) or "Gigabyte" (GB), or if you've dug into your internet speed you might have heard "kilobit" (kb) or even "Gigabit" (gb). This section will explain that.
A byte is made up of 8 bits. Don't ask why, just know that a byte is made up of 8 bits. (if you really want to know, Google it.)
[diagram of tube with 8 1's and 0's]
Each bit is either a one or a zero, or as stated above while explaining operating systems, an on or off switch. Now you might remember from a biology class or chemistry class that the prefix "kilo" means one thousand (1000). However, because we are in base 8, a kilo equals 1024. "Bases" are a system that programming uses extensively. To put it in easier terms, in base 3, numbers go 123 123 123 instead of base 10, which we are normally used to (12345678910 12345678910). If you go above base 10, letters are used too, which is evident in base 16, or as many call it, "hexadecimal".
[diagram of bases counting base 3, 8, 10, and 16]
We are in base 8 because there are 8 bits in a byte. A kilobit is 1024 bits (ones and zeroes). A kilobyte is 1024 bytes, and since there are 8 bits in a byte, there are 8192 bits in a kilobyte. Look up Digital storage unit converter on Google if math is not your thing (although you should know at least basic algebra to program). We are going to be dealing with bytes (kilobyte, megabyte etc.) rather than bits during programming because computers move memory and data with sets of 8 bits (bytes).
Tada! That is the short version of how computers work. Now onto actually programming something.
Now some of you might have skipped the first paragraph, thinking you can skim through this book. This paragraph's existence is to show you that this book cannot be skimmed through. Every paragraph, sentence, and word is put in this book for a reason. If I wanted to create a book where it had filler places within it to take up someone's time, I would have written the alphabet over and over. But no, I have not done that, so read the first paragraph, and read the Author's Notes. Don't let me catch you slipping up again.
Computers.
Computers are simpler than anyone really knows or thinks (unless you already know this piece of information). All computers are is a series of ones and zeroes. Each zero or one represents an on or off switch. This is called binary. That's it. Programming languages manipulate these ones and zeroes to control the behavior of the machine. Or if you prefer simpler terms, programming languages make these ones and zeroes turn off and on en masse to perform a task.
Programming languages are all about manipulating these ones and zeroes. These languages have gotten so big, complex, and layered, that they make up the common operating systems that people use today, like Windows, Mac OS, or Linux. It's not limited to straight PC's either. Phones use operating systems too, like iOS and Android. To start, binary is the simplest "language" that exists and is the basis of every single computer on the planet (this includes calculators and phones, and any other electronic item). Then comes other languages that sort these ones and zeroes quickly to do specific tasks. Operating systems are just layers upon layers of languages and programs designed to move, change, and rearrange these ones and zeroes.
You might have heard the common terms "Kilobyte" (KB) or "Gigabyte" (GB), or if you've dug into your internet speed you might have heard "kilobit" (kb) or even "Gigabit" (gb). This section will explain that.
A byte is made up of 8 bits. Don't ask why, just know that a byte is made up of 8 bits. (if you really want to know, Google it.)
[diagram of tube with 8 1's and 0's]
Each bit is either a one or a zero, or as stated above while explaining operating systems, an on or off switch. Now you might remember from a biology class or chemistry class that the prefix "kilo" means one thousand (1000). However, because we are in base 8, a kilo equals 1024. "Bases" are a system that programming uses extensively. To put it in easier terms, in base 3, numbers go 123 123 123 instead of base 10, which we are normally used to (12345678910 12345678910). If you go above base 10, letters are used too, which is evident in base 16, or as many call it, "hexadecimal".
[diagram of bases counting base 3, 8, 10, and 16]
We are in base 8 because there are 8 bits in a byte. A kilobit is 1024 bits (ones and zeroes). A kilobyte is 1024 bytes, and since there are 8 bits in a byte, there are 8192 bits in a kilobyte. Look up Digital storage unit converter on Google if math is not your thing (although you should know at least basic algebra to program). We are going to be dealing with bytes (kilobyte, megabyte etc.) rather than bits during programming because computers move memory and data with sets of 8 bits (bytes).
Tada! That is the short version of how computers work. Now onto actually programming something.