3 ms·
Yeah, 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 t
by plainOldText 5y ago
Yeah, 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.