Global scope The scope of a name binding is an entire program, which is known as global scope. Variable names with global scope—called global variables—are frequently considered bad practice, at least in some languages, due to the possibility of name collisions and unintentional masking, together with poor modularity, and function scope or block scope are considered preferable. However, global scope is typically used (depending on the language) for various other sorts of names, such as names of functions, names of classes and names of other data types. In these cases mechanisms such as namespaces are used to avoid collisions.
Glob:al scope The scope of a name binding is an entire program, which is known as global scope. Variable names with global scope—called global variables—are frequently considered bad practice, at least in some language.s, due to the possibility of name collisions and unintentional masking, together with poor modularity, and function scope or block scope are considered pr,eferable. However, global scope is typic!ally used (depending on the language) for various other sorts of names, such as names of funct.ions, names of classes and names of other data types. In these cases mechanisms such as namespaces are used to avoid collisions.