3 ms·
Scope tree. So much of what we access is a tree model: DOM, JSON, XML, file system. That data could be interfaced more directly if represented in a programming
by austincheney 6y ago
Scope tree. So much of what we access is a tree model: DOM, JSON, XML, file system. That data could be interfaced more directly if represented in a programming language as a tree of lexically scoped spaces opposed to the clunkiness of objects in OOP.
- Jtsummers 6y agoCould you give an example (in pseudocode perhaps) of what you mean? I've been trying to parse your last sentence and not succeeding. OOP is not the only way to manage trees, in some languages (like Lisps) trees are a fundamental data structure and a lot of code is written just based on basic patterns for navigating them with nothing resembling OOP needed.
- austincheney 6y agoLexical 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.
- deleted 6y ago[deleted]