Chapter 6: Limiting Scope Exposure

So far our focus has been explaining the mechanics of how scopes and variables work. With that foundation now firmly in place, our attention raises to a higher level of thinking: decisions and patterns we apply across the whole program.

To begin, we’re going to look at how and why we should be using different levels of scope (functions and blocks) to organize our program’s variables, specifically to reduce scope over-exposure.