4 ms·
Shout out for asp.net core projects, where every frickin' class looks like: class MyService { ILogger<MyService> _logger MyService(ILogger<MyService> log
by cheradenine_uk 5y ago
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.
- cheradenine_uk 5y agoOh ,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.