Write return a + b; in C++ and give it to a compiler. With its optimizer
switched on, what comes out for the processor in a typical Linux PC is
four numbers: 141, 4, 55,
195. That's the whole of it. The processor never sees your names, your
plus sign or your semicolon, only numbers like these, one small step
after another. This course is about those numbers: where they come from,
what they mean on three different families of processor, and why the
same C++ can become very different machine code.
You don't need to have studied any of this before. You do need a little C++ and a way to build and run a program, and this chapter supplies both, whether you come from C++, C#, Java or Python.
The first section separates source code, the text you write, from machine code, the numbers the processor follows. It also explains why a Java, C# or Python programmer has usually never seen the machine code of their own program. A compiler to bytecode, a virtual machine or an interpreter stood in between.
The next two sections teach just enough C++ to read every example in the book. The first covers whole numbers whose size is part of their name, arithmetic, decisions, loops, and reusable named pieces of code. The second covers rows of values, grouped values, and text. Each idea comes with a table showing how Java, C# and Python spell the same thing.
The fourth section opens the text window where you build programs by typing commands, on Windows, macOS or Linux, and builds and runs a small C++ program from it. The last section explains how the course itself works. It covers the two ways each idea is written and the caption on every listing. It also covers the three places code runs, from the outputs captured when the course was built to the labs you run on your own machine.
By the end you'll be able to read the C++ half of every example in this course, and build and run a program of your own. Chapter 1 then shows what happens to it on the way to those four numbers.