3 ms·
At least I can instantly tell which call is ultimately returning something, in that version.
by yamtaddle 4y ago
At least I can instantly tell which call is ultimately returning something, in that version.
- scotty79 4y agoThere's nothing preventing you from not using the pipe for last call or even introducing that rule in your team if you can convince your colleagues it's a good idea or even automate it with the use of a linter. If it's really good rule you can advocate for it at this stage. It might be prudent to use |> % only inside function call parameter or possibly as right hand of an assignment instead of everywhere where parser expects an expression. a(b(),c(), g() |> f(%) |> d(e(), %)) Although I'll be honest, I don't like it. Other parameters of a() call for me occlude the flow and the intent. We could make it a bit better with newlines. a(b(),c(), g() |> f(%) |> d(e(), %)) ) But if a() takes more parameters after the main one then we have the same problem as usual where parts of the same call can end up far away from one another. a(b(),c(), g() |> f(%) |> d(e(), %)) x(), y(), z()) For me g() |> f(%) |> d(e(), %)) |> a(b(), c(), %, x(), y(), z()); is still better and I wouldn't want it to be prevented by language syntax.