Re:What's Wrong with Tech Hiring
by Aeolun on Thursday September 16, 2021 @10:34AM
(#28552349)
DI makes testing nice. People approximate it with hacks, but you need DI for truly good unit tests.
[ Parent
| on HN ]
Really depends on the whole structure. If it is mainly FP, dependency rejection usually is actually the easiest to test with
I dunno how you can combine dependency injection (as I imagined it in the original comment) with FP in the first place.
Without classes what would you be injecting? Other functions? That’s still something that happens all the time in FP.
I was thinking sideeffectful functions. Such as DB accesses.
> dependency rejection
That’s secretly the most powerful design strategy.