4 ms·
Thanks for bringing that up. The shift to using the pipe operator has been an intriguing development in the community, and I've given some thought to what it im
by jasperry 5y ago
Thanks for bringing that up. The shift to using the pipe operator has been an intriguing development in the community, and I've given some thought to what it implies about the difficulty of programming in functional syntax.
The pipe operator helps if you have a clean sequence of steps and each function returns only the needed input for the next step. The code becomes just as unwieldy if an argument isn't in the right position, so you have to splice in a lambda, or you have to split cases on the result, in which case you have to do something monadic if you want to avoid deeper nesting. All of which looks like unnecessary friction when I know perfectly well in my head what the computation needs to do after each step.
Also, when you have the pipe operator in your toolbox you now have a decision between two styles of coding that are basically inside-out from each other.
- dnautics 5y ago> The code becomes just as unwieldy if an argument isn't in the right position, so you have to splice in a lambda, or you have to split cases on the result I disagree. This is pretty clear even though it does exactlywhat you claim is terrible, and it is far, far clearer than the corresponding imperative code: https://twitter.com/DNAutics/status/1421465090856005633?s=19 https://twitter.com/DNAutics/status/1421465090856005633?s=19 Clarity in important when you're doing code reviews or fixing a bug, in anger.