Re:Working pipe operator today in pure JavaScript
by tinyspacewizard on Wednesday October 08, 2025 @12:44PM
(#45518111)
There is more than one proposal; the F#-style one doesn't have the (weird) placeholder syntax.
> You can still make it work by adding it to the prototype
This is exactly what we want to avoid!
Re:Working pipe operator today in pure JavaScript
by nonethewiser on Wednesday October 08, 2025 @01:43PM
(#45518689)
wrap the object?
Why would you want to avoid that? It's controversial syntactic sugar. Enforcing a convention locally seems ideal.
Re:Working pipe operator today in pure JavaScript
by tinyspacewizard on Thursday October 09, 2025 @04:24AM
(#45524990)
1. Wrapping is more code than using a built-in pipe operator
2. There is a run-time overhead to wrapping
IMO a design goal of programming langauges should be for the most readable code to also be the most performant.
Language features tend to be controversial until they are mainstream.
But besides that, I think the better steelman would use methods that dont already exist on the prototype. You can still make it work by adding it to the prototype but... meh. Not that I even liket he proposal in that case.