Scope (computer Science)
In computer programming, a scope is the context within a computer program in which a variable name or other identifier is valid and can be used, or within which a declaration has effect. Outside of the scope of a variable name, the variable's value may still be stored, and may even be accessible in some way, but the name does not refer to it; that is, the name is not bound to the variable's storage.
Various programming languages have various different scoping rules for different kinds of declarations and identifiers. Such scoping rules have a large effect on language semantics and, consequently, on the behavior and correctness of programs. In languages like C++, accessing an unbound variable does not have well-defined semantics and may result in undefined behavior; and declarations or identifiers used outside their scope will generate syntax errors.
Scopes are frequently tied to other language constructs, but many languages also offer constructs specifically for controlling scope.
Read more about Scope (computer Science): Scope Outside A Function, Lexical Scoping and Dynamic Scoping, Qualified Identifiers
Famous quotes containing the word scope:
“A country survives its legislation. That truth should not comfort the conservative nor depress the radical. For it means that public policy can enlarge its scope and increase its audacity, can try big experiments without trembling too much over the result. This nation could enter upon the most radical experiments and could afford to fail in them.”
—Walter Lippmann (18891974)