3 ms·
I tell people it's about focusing on inputs and outputs rather than worrying about inputs and side-effects. It let's you develop complex programs with clear se
by im_down_w_otp 9y ago
I tell people it's about focusing on inputs and outputs rather than worrying about inputs and side-effects.
It let's you develop complex programs with clear separation of responsibilities without having to try to keep the model of the entire state-space in your head at once.
- danek 9y agoYeah, I find that pure functions (or pure functions living in immutable objects) makes my code immensely more composable and easier to work with (i.e. more adaptable and less expensive to own). If some business requirement changes I can recompose and tweak existing code without reading every line of code to figure out what side effects may unintentionally get triggered.
- disantlor 9y agoI never really properly learned TDD and always felt a bit bad about it. Then I discovered this side effect (or primary effect) of FP and felt like there was no real need for tests. Not sure if I'm just rationalizing but the ability to drop into the data flow and make changes or add features with confidence makes programming so much more fun.