Third Advantage of Procedures

When code is isolated into its own procedure, it greatly reduces the effects of changes to that code. This goes back to the idea of the black box. As long as the procedure itself maintains its predictable inputs and outputs, changes to the code inside of a procedure are insulated from harming the code that calls the procedure. If we decide we don't want to use a loop anymore in the GetUserName function, we can change the code to only ask the user his name once instead of five times. The code that calls the GetUserName function won't care.

First