4 ms·
Lexical scope allows nested spaces. Things declared in higher scopes are shared points of access to things declared in lower scopes but not the opposite, thus y
by austincheney 6y ago
Lexical scope allows nested spaces. Things declared in higher scopes are shared points of access to things declared in lower scopes but not the opposite, thus you have an active tree of of programming language references/variables in memory.
Lexical scope is optionally available is most modern languages now and is the default scope mechanism in lisp and JavaScript.
If the data is a tree and your scope mechanism is a tree there is an opportunity for one to directly represent the other. Doing so will eliminate much decoration in the code and thus increase execution performance and increase the legibility of the code.
This would not be for the faint of heart though. My professional experience tells me many people can not grasp trees at all whether in data, file system, or programming. You can try to dumb it down or abstract it away for the lost souls, as is common, but that is tech debt and an erosion of performance.