David Bruant wrote:
Le 10/07/2013 19:28, Brendan Eich a écrit :
David Bruant wrote:
I can't find it anymore, but I read a message from Mike Shaver (I think it was him) saying that these methods have been standardized after SpiderMonkey implementation without other form of rationale.
Who needs this particular consistency anyway?

Users generally benefit from this kind of consistency; we hear complaints about reduce/reduceRight.
People seem to have survived reduce/reduceRight.

This isn't about "survival" as you yourself pointed out, since bind (polyfillable) is an option. This is about "best API ergonomics/consistency/cognitive-load". Play fair now!

The perf savings is an allocation
Do engines allocate each time when a function expression is used as first argument?
If so, .bind doesn't cost more than a function expression.

So? My main point was not perf.

but the cognitive load win seems more important. Telling people to use .bind (polyfilled) involves more typing and thinking.
I guess... Are reduce/reduceRight acquiring a thisArg, then?

No, it's too late for those two, and thisArg didn't fit consistently in the parameter list anyway, as we have discussed here in the past.

It's not too late for find and findIndex, and they do fit the pattern.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to