Hacker News new | ask | show | jobs
by joelhooks 4695 days ago
Require is a service locator, so you are getting some of the inversion of control benefits, but I greatly prefer the injections of the dependencies I need instead of relying on a locator.

In practice the DI approach is very nice, and works consistently. It also makes unit tests more straight forward.