Hacker News new | ask | show | jobs
by arendjr 1369 days ago
The pipeline operator currently sits at Stage 2 as an ECMAScript proposal. Many people (including me) believe the current proposal is a harmful addition to the language, and it would be better to not have a pipeline operator than the current Hack proposal. For this reason, I created the linked ESLint plugin.
1 comments

Can you give me the gist of why it would be considered harmful?
Unlike pipe operators in functional languages, the Hack proposal is aimed at composition of expressions instead of functions. This makes the proposal extremely pervasive and unfocused, enabling people to write `a |> %[0]` instead of `a[0]`, for instance.

Proponents argue it’s great because you can pipe arbitrary expressions without nesting or needing temporary variables, but opponents argue it harms readability and will result in needless style arguments.

Makes sense. Could linters solve this issue?