Re:Dependency injection is dynamic scoping in disguise
by eru on Friday November 01, 2019 @06:16AM
(#21417412)
> One common pattern in this system was that you'd first save the current environment, run the special "environment preparation" function, then the real function, and then write back the saved environment over the modified one, so that you didn't leave the environment changed after you returned.
That sounds exactly like dynamic scoping.
This was probably only in the top ten of the problems that this thing had, but I do remember it vividly. Making any change was like pulling out a Jenga block and replacing it without toppling the tower.