4 ms·
> Just like lambda syntax makes it much easier and readable to write small functions, the pipe operator make it much easier and readable to write chains. succi
by throw_m239339 5y ago
> Just like lambda syntax makes it much easier and readable to write small functions, the pipe operator make it much easier and readable to write chains.
succinct =/= more readable.
Readability here is really in the eye of the beholder...
It's certainly quicker to type, but that's not a good argument enough to make such a drastic change in javascript.
- VenTatsu 5y ago> It's certainly quicker to type, but that's not a good argument enough to make such a drastic change in javascript. I am so glad this argument has not been winning out in the JavaScript language design community. There are so many wonderful constructs that have been added in the last 20 years that are just sorter ways to write things that could mostly already be done in the language. Many of these features focused on allowing developers to write what they intended to do without having to explicitly construction the intermediate steps to express the mechanics of how that should be carried out using basic language features. After all why do we need arrow functions when we could just sprinkle our code with `var self = this;` declarations for anonymous functions to bind to, the way it was done in the late 90's and early 00's. I'd much rather JavaScript adopt succinct ways to write common code patterns and let the developers and the community decide if those constructs are the correct ones to use on a case by case basis.
- magicalist 5y ago> I am so glad this argument has not been winning out in the JavaScript language design community. There are so many wonderful constructs that have been added in the last 20 years that are just sorter ways to write things that could mostly already be done in the language. Beware of survival bias, though. There have been many proposals that aren't part of JS today.