Programmers are used to writing programs that are executed in a linear fashion. As you write, test, and execute your program, you expect your instructions to run in the order that you wrote them. In Listing
1-1, you have a program that will first assign a variable
a to the number
2. It will then assign a variable
b to the number
3, followed by assigning a variable
sum, the sum of
a + b, and it will finally print a result to the console. There is no way this program will work if you try to
print(sum) before you even managed to calculate the value for
sum.