4 ms·
Agree with almost everything, but one point doesnt attempt to reason about the pattern. Why shouldn't I pipe into a case expression? It's visually pleasing, m
by toolz 5y ago
Agree with almost everything, but one point doesnt attempt to reason about the pattern. Why shouldn't I pipe into a case expression? It's visually pleasing, more concise and removes an empty line.
Easier to talk about where I disagree, but overall great read!
- plainOldText 5y agoYeah, it wasn’t obvious why one should avoid |> case. I also think it looks pleasing, plus it’s easy to read and it avoids allocating a new variable compared to the alternative example given.
- keathley 5y agoI didn't make a very strong case for it. Overall, my experience has been that calling the side-effecting function in the case statement directly tends to be easier to maintain and easier to read. But, I think piping into case can work well in certain situations. Its not one of the points that I feel that strongly about.