8 ms·
This article was so helpful in communicating my exact frustration with DI in .NET. "Why does this have to be so complicated? This is so simple in JavaScript." j
by arcosdev 5y ago
This article was so helpful in communicating my exact frustration with DI in .NET. "Why does this have to be so complicated? This is so simple in JavaScript." just kept running through my head the entire time.
- capableweb 5y agoWhy can't you just do DI the same way you do it in JS? You can pass Objects as parameters to functions and that's all you need.
- arcosdev 5y agoYou are right, but I was learning they way "it is done" at the time.
- thrower123 5y agoAspNet style dependency injection has dug it's claws in to an insane degree, and it's almost always completely unnecessary. If you're never going to change the implementation of a logger or a database connection, there is almost zero value in standing up the whole DI machinery rather than a simple singleton.