4 ms·
> real world business logics often does require side effects Yeah, all business logic requires side effects, else it is doing nothing :). But following some F
by z9znz 4y ago
> real world business logics often does require side effects
Yeah, all business logic requires side effects, else it is doing nothing :).
But following some FP practices, you can push the side effects very far out to ward the edges. Instead of typical OOP, where objects get passed around and mutated anywhere and everywhere (which makes identifying where certain things started to go wrong), with pure, single responsibility functions you can write very simple but thorough tests which give you vastly more confidence about the code. And as a huge added benefit, the lines of test code actually go down because there's so much less setup and teardown (mocking, stubbing, etc.).