News for hackers. Stuff that matters.
Re:Printf(“%s %s”, dependency, injection) by cheradenine_uk on Wednesday October 20, 2021 @03:53AM (#28927961)
Shout out for asp.net core projects, where every frickin' class looks like:

class MyService {

  ILogger<MyService> _logger

  MyService(ILogger<MyService> logger) {
    this._logger = logger;
  }
}

Making it a monumental PITA to use without the associated Jungle: The chosen DI framework. Why is the ILogger generic? Because of the DI framework, so it can create a logger that corresponds only to this type.

We're literally writing code to keep the framework happy.

Re:Printf(“%s %s”, dependency, injection) by cheradenine_uk on Wednesday October 20, 2021 @03:56AM (#28927983)
Oh ,and while I'm at it, literally everything is defined twice, once in an interface, once in an implementation.

Even though there are no other implementations.

Why? Seems to boil down to "our language / environment / DI system / mocking framework is incapable of working unless you do it this way.

Yet more cognitive and implementational waste.