- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Mon, 29 Feb 2016 12:01:20 -0800
- To: Domenic Denicola <d@domenic.me>
- Cc: Marcos Caceres <marcos@marcosc.com>, public-script-coord <public-script-coord@w3.org>
On Mon, Feb 29, 2016 at 4:56 AM, Domenic Denicola <d@domenic.me> wrote: > From: Marcos Caceres [mailto:marcos@marcosc.com] >> Could I kindly ask for some clarification or a pointer from TC-39 members? If not returning the object, is there a new pattern? > > I think it would be more accurate to say the pattern is contentious among TC39 members. I think it's terrible; it violates basic software engineering principles like command-query separation [1] in order to save a few characters of typing. > > However, my guess would be that future collection classes designed by TC39 will continue this tradition, simply for consistency. This is similar to many other contentious decisions that we will probably carry forward forever, like adding a `thisArg` to all collection map/filter/reduce/etc. methods, or ensuring that all forEach callbacks always get three arguments even when it makes no sense (like for Set). > > So it might be appropriate for URLSearchParams. Agreed. I don't have strong opinion either way on whether the pattern is good, but Map and Set return themselves from the corresponding operations, and URLSearchParams is just a Multimap, so it should follow suit. ~TJ
Received on Monday, 29 February 2016 20:02:08 UTC