4 ms·
Isnt dynamic scoping a bit similar to Dependency Injection? Maybe there's a form of it that could be useful. Like explicit dynamic scopes?
by rat87 1y ago
Isnt dynamic scoping a bit similar to Dependency Injection? Maybe there's a form of it that could be useful. Like explicit dynamic scopes?
- eru 1y agoWell, isn't dependency injection just a more cumbersome way to say 'function arguments'? Dynamic scoping is exactly the same, it's basically equivalent to extra implicit function arguments that are passed through everywhere. And yes, dynamic scopes can be useful in specific cases. What's wrong is having your variables scoped dynamically by default.