tc39 / proposal-pipeline-operator

A proposal for adding a useful pipe operator to JavaScript.
http://tc39.github.io/proposal-pipeline-operator/
BSD 3-Clause "New" or "Revised" License
7.56k stars 108 forks source link

New motivation #296

Open lilnasy opened 1 year ago

lilnasy commented 1 year ago

After an early implementation of it broke websites, the proposal for array grouping is switching from Array.prototype.group (instance method) to Array.group (static method). The sentiment expressed by implementers is that they don't want to keep extending prototypes, and hoping it doesn't break the web.

This signals that method chaining will become less and less viable over the next decade. It might be worth it to add this to the explainer as a motivation once grouping reaches stage 3 again.

ivan-kleshnin commented 2 months ago

TC-39 is obsessed with backward compatibility. Meanwhile, thousands of sites disappear every day... Some of them are heavily linked, many contain(ed) unique and valueable content.

If "don't break the web" is so important why we allow site removal to ever happen. If it's not so important – why does TC-39 religiously follow this idea 🤔

ljharb commented 2 months ago

@ivan-kleshnin It wouldn't be possible to prevent someone from taking down a site, and it is MUCH more important than any language feature.

ivan-kleshnin commented 2 months ago

Well, we still have web.archive.org and other projects that attempt(ed) to preserve information. The largest one, WaybackMachine goes through deep financial troubles and AFAIK can soon be closed. Because nobody, in position of power, cares enough. Was there a single call to support it from W3C or TC39 members?

Backward compatibility is one of the most important features, indeed. But it's solved with versioning in all other languages in existence. And I don't buy the claim that it was impossible to do with JS. It was possible (strict mode), just it wasn't important enough.

What I (we) see is that TC-39 is much more aligned with business goals (keep the apps up and running, at any cost) than programmers goal (reduce the suffering). Points taken.

ljharb commented 2 months ago

@ivan-kleshnin i'm sure there have been many, but the two things are unrelated.

JS can't be realistically versioned - there's tons of articles on the web that explain why.

The suffering that matters is the suffering of users who would be using the broken sites, which matters infinitely more than the suffering of programmers.

ivan-kleshnin commented 2 months ago

I disagree with all points. 1) Matter of priorities, totally doable 2) Suffering of programmers clearly leads to suffering of users. Otherwise we wouldn't download megabytes of React-JS to render a text page that gzips to less than 1 Kb.

That's my last post here, won't bother anymore. Just wanted to fix two opposite points of view for digital archaeologists.

michaelschufi commented 1 month ago

As I understand, the pipeline operator is also useful in scenarios where we have nesting instead of prototype chaining, as described here: https://github.com/tc39/proposal-pipeline-operator?tab=readme-ov-file#pipe-operators-combine-both-worlds While prototype chaining might become less popular, this part of the proposal is still very relevant.