Outline
It is considered best practice to avoid using global variables because they open an app up to numerous opportunities to fail. Because global variables can be accessed and modified from anywhere, they can easily cause problems that are difficult to diagnose.