Sponsored · Amazon offerTry Amazon Prime freeFast free shipping, Prime Video and more.Start free trial
SponsoredShop Amazon for Global scopeBrowse products on Amazon.Search Amazon
SponsoredAmazon Best Sellers in Office ProductsUpdated hourly by Amazon.Shop best sellers
Sponsored · Popular on AmazonHealth & HouseholdBooksAutomotiveArts, Crafts & Sewing
As an Amazon Associate I earn from qualifying purchases.

Topic summary

Global scope

Global scope

Extracted from the Wikipedia article Scope (computer programming).

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.