Hacker News new | ask | show | jobs
by memhole 462 days ago
Good to know. I assumed it was all done via objects or things like objects.

So is piping more functional programming?

1 comments

I think it's often a syntax convenience. For example, Polars and Pandas both have DataFrame.pipe(...) methods, that create the same effect. But it's a bit cumbersome to write.

Here's a comparison:

* Method chaining: `df.pipe(f1, a=1, b=2).pipe(f2, c=1)`

* Pipe syntax: `df |> f1(a=1, b=2) |> f2(c=1)`

Ok, that’s helpful. Thanks!