Deliberate Scope in Web Applications
Table of Contents
Web applications can be divided into two general categories, depending upon the scope to be implemented in their design and development.
Global scope means that the program will draw upon and update an overall state, which can be referenced from anywhere within the program. Examples may include applications that remember the identity of the user, or generally remember notifications.
Lexical scope (or block scope) indicates more modularity in the program; functions in the program wuill generally be self-contained and will operate upon data they are provided, not upon external data. The more strictly an application exhibits lexical scoping the more easily it can be reasoned about, debugged, and maintained.
Other types of scope are rarely seen in web application development and design. However, whatever scope is adopted for application design, the real failure would be not being deliberate and principled in deciding your scope.