Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isnt dynamic scoping a bit similar to Dependency Injection? Maybe there's a form of it that could be useful. Like explicit dynamic scopes?


Well, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: