The scope of an identifier is the region of the program where applied occurrences refer back to this binding occurrence, i.e., the lexical range in which that identifier is visible . The scoping rules of a PL determine how occurrences of variable names are associated with variables. Clearly alpha-conversion is a valid rule under static scoping. It says that an applied occurrence refers to the binding occurrence in the most recently entered scope. Dynamic scoping requires keeping knowledge of names at runtime.
Names refer to values in the most recently entered scope, which can only be known at runtime.
Sometimes dynamic scoping is convenient. The behavior of a function can be changed without recompiling, just by calling it from inside an environment where global identifiers have different bindings. The example above shows that assignment commands also make programs harder to understand. The fundamental advantage of functional programming languages is that they are easier to understand, because they do not have the complexity of assignment commands. If a program is easier to understand, it is also easier for a compiler to optimize.