Using functions also allows us to modularize our approach to writing the code. This means that we can break up the processing into sections and not concern ourselves with how all of the processing needs to work all at the same time. When we are coding the function we need only concern ourselves with how the function needs to be coded in order to perform its intended task. When we are writing the code that calls the function we don’t can assume that the function will perform that task without having to concern ourselves with how it does it We will look at a more advanced way of modularizing things still further later in the book when we discuss object.
The alternative is a bottom up approach. This is where you write the functions first and then link them together.
Except where you already have the functions written and are going to reuse them (another advantage of using functions), you will probably find that a top down approach is easier. You will have a better idea of what each function actually needs to do if you know where it will be used before you write it.