Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I don't see how this is better

Case in point:

> you can add helpful comments to pipeline code if needed

The pipeline with explanatory variables explain to you what the steps are with code. Using pipeline you need to add comments to explain "what" you are doing.



Then you can mix-and-match:

    const activePlayers = 
      players
      |> filter(x => x.isAlive)

    const highestScore = 
      activePlayers
      |> map(x => x.score)
      |> tryMax
In any case, I don't see how being restricted to always using an intermediary variable for every step is an advantage.


And then it's a pleasure to open the debugger and immediately see the values for each step.


If pipes are added to JS then IDE support will follow very swiftly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: