|
|
|
|
|
by nilslindemann
315 days ago
|
|
Your simple example (`2 |> Math.sqrt`) looks great, but when the code gets more complex, then the advantage of the pipe syntax is less obvious. For example, foo(1, bar(2, baz(3)), 3)
becomes something like 1 (2, (3 |> baz) > bar), 3 |> foo
or (3 |> baz) |> (2, % |> bar) |> (1, %, 3 |> foo)
That looks like just another way to write a thing in JavaScript, and it is not easier to read. What is the advantage? |
|
The goal is to linearlize unary function application, not to make all code look better.