▲ | qwertox 8 days ago | |||||||
It's true that pipes are more readable, and for many cases they will be the better option, but the example of nested functions just doesn't hold. That's like saying someone would use this:
which is harder to reason about than the nested functions.
or
| ||||||||
▲ | navalino 8 days ago | parent | next [-] | |||||||
It is more readable and better option — you have to parse it from the innermost function to the outermost just to understand what it's doing. With the pipe, it's more straightforward: you read it step by step — do this, then that, then the next — just like how you'd naturally read instructions. | ||||||||
▲ | troupo 7 days ago | parent | prev | next [-] | |||||||
Why didn't you format the pipes, too?
vs
With pipes you have linear sequence of data transformations. With nested function calls you have to start with innermost function and proceed all the way top the outermost layer. | ||||||||
| ||||||||
▲ | account42 7 days ago | parent | prev [-] | |||||||
The pipe syntax is much more readable than nested function calls when you need additional arguments for intermediate functions. With nested functions it becomes hard to see which functions those arguments belong to even if you try to help it with formatting. |