4 ms·
I associate this aversion to infectiousness with the same mentality that brought us dependency injection and the architecture of tightly coupled singletons: "I
by SebastianKra 3y ago
I associate this aversion to infectiousness with the same mentality that brought us dependency injection and the architecture of tightly coupled singletons:
"I want to..." "...block anywhere" "...use IO anywhere" "...mutate anything anywhere" '...have access to all state everywhere"
But, expanding on the articles point, we _do_ have to deal with these details. If I use IO anywhere in the call stack, then I make it unavailable for unit testing. If I block anywhere, then I potentially freeze some UI code. If I fire and forget async operations, I will have a harder time handling errors and knowing when an operation is finished. If I don't keep my mutable state minimal/isolated, I will encounter internal inconsistencies.
In my experience, keeping these concepts at the top, helps to keep your code testable and understandable.