``` foo(bar(baz(new_function(other_function())))) ```
They offer this example of an improvement:
``` other_function() |> new_function() |> baz() |> bar() |> foo() ```
While yes, pipes improve readability, how do they deal with errors? How do they deal with understanding what each thing is supposed to return?
I would prefer something like this, (descriptive variable names):
``` var userData = other_function();
var userDetails = new_function(userData);
var userComments = baz(userDetails);
var userPosts = bar(userComments);
var finalUserDetails = foo(userPosts);
return finalUserDetails; ```
Then I can easily debug each step, I can easily understand what each call is supposed to do, if I'm using type script, I can assign types to each variable.
I strongly oppose clean code for the sake of looking pretty, or being quick to type. Code is meant to be run and read more then written, it should be descriptive, it should describe what it's doing not a nasty chain of gibberish. Hence why most people hate REGEX.