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:
“As the creative adult needs to toy with ideas, the child, to form his ideas, needs toysand plenty of leisure and scope to play with them as he likes, and not just the way adults think proper. This is why he must be given this freedom for his play to be successful and truly serve him well.”
—Bruno Bettelheim (20th century)