3 ms·
Few things : - functional is accumulative in thinking. I can evaluate each step gradually without doing anything more than function composition. In imperative
by agumonkey 13y ago
Few things :
- functional is accumulative in thinking. I can evaluate each step gradually without doing anything more than function composition. In imperative programming its coupled.
- functional is side-effect free, can't mis-assign res.
- functional is abstract friendly, I can pass the predicate I want, same for accumulation/combination.
I kinda agree that the imperative code is somehow easier to read (3 little chunks of lines instead of 3 nested composition) but to write, test or adapt the functional way as some advantages.