Re:Forget monoliths vs. microservices: cognitive load is wha...
by GordonS on Friday June 21, 2019 @03:49AM
(#20240706)
> got a lot of vocal pushback from the TDD community who see great value in adding dependency injection and an interface to every library call you make
Hah, adding a matching interface for every..single..class is something that drives me nuts! Many C# devs seem to have fallen into this trap, because "I need it for mocking". Sure, but do you actually need to mock out the dependency? IMO, overuse of mocks makes for brittle tests that are painful to maintain. I prefer only mocking "complex" dependencies.
In any case, hopefully C# 8's default interface methods will help alleviate this madness.
Hah, adding a matching interface for every..single..class is something that drives me nuts! Many C# devs seem to have fallen into this trap, because "I need it for mocking". Sure, but do you actually need to mock out the dependency? IMO, overuse of mocks makes for brittle tests that are painful to maintain. I prefer only mocking "complex" dependencies.
In any case, hopefully C# 8's default interface methods will help alleviate this madness.