News for hackers. Stuff that matters.
Re:Functional programming is not popular because it is weird... by isaacimagine on Tuesday September 14, 2021 @03:34AM (#28521504)
What I like about pipes it that it allows two ways to write chains of function calls. For calls that are more branch-like, the nested structure of standard function calls makes the most sense to me:

    article = create(author("John"), Page.article())
For cases where you're modifying data sequentially, the pipe structure makes it really easy to read:

    5th_prime = 0.. | filter(is_prime) | nth(5)
Having a way to write function calls forwards and backwards lets you choose whatever syntax feels most appropriate for the job.

There are no comments on this comment yet.