3 ms·
> It's a fair rule of thumb that the more pure a function is, > the easier it is to reason about its behaviour in a larger program. Yes, but there are a LOT o
by mpweiher 10y ago
> It's a fair rule of thumb that the more pure a function is,
> the easier it is to reason about its behaviour in a larger program.
Yes, but there are a LOT of other factors that contribute to reasoning about functions (or methods). Though purity helps, naming (intension revealing selector) is actually more important, at least to me, and function chaining with unnamed intermediary results actually reduces readability significantly (though it seems cool).
- smoothdeveloper 10y ago> and function chaining with unnamed intermediary results actually reduces readability significantly For me this is the reverse, having assignment (to verbose and often redundant named identifers) interrupting the flow adds a lot of visual noise compared to an expression using chaining functions (using say |> operator in F#).