6 ms·
I've never found this style readable unless with pipes (bash / elixir), where I love it. With any other syntax, I find it just adds mental overhead. Maybe becau
by notemaker 3y ago
I've never found this style readable unless with pipes (bash / elixir), where I love it. With any other syntax, I find it just adds mental overhead. Maybe because you have to read it backwards?
- technojamin 3y agoPipes in both of the languages you specified do function application, not composition, so they’re very much point-ful (you see the arguments you pass/get passed).
- euiq 3y agoI assume they're talking about code like x |> f a |> g b … … where everything after the first |> is essentially in point-free style.
- diggan 3y agoClojure (and I'm sure other lisps and programming languages) have a nice solution to this, the `->` macro ("threading") You'd do something like: (save (transform (fetch))) ;; calls fetch, then transform, then save (-> (fetch) (transform) (save)) Not that the non-threading version was hard to read, but once the function names start to be a bit longer and involve arguments, the threading version tends to be a lot easier to read.