On Wed, Dec 5, 2012 at 1:04 PM, Mark S. Miller <erig...@google.com> wrote:
> On Wed, Dec 5, 2012 at 1:50 AM, Jussi Kalliokoski > <jussi.kallioko...@gmail.com> wrote: > > My 2 cents against the windmills... > > > > I personally think returning `this` in absence of any meaningful value > (and > > chaining in general) is a bad pattern. Chaining leads to worse > readability > > (there's nothing subjective about this, if you have to scan the code to > > another page to figure out which object the code is interacting with, > it's > > bad readability) > > This is an excellent point, and has changed my mind. I return to not > supporting the "return this" for these cases. Thanks. > In the cases that we identified as qualifying for the criteria that you established at the meeting, a "chain" will most likely only have one more method call or property access after .set()—any of the iterable producing methods (keys, values, entries), forEach, or the size property. But this also now makes any operation where I want to mutate the map/set and immediately do something with that object a two part exercise. "some people will misuse it" can be the argument for anything, that doesn't make it a strong or meaningful argument. cc'ing Doug Crockford, Erik Arvidsson, Alex Russell, Yehuda Katz to weigh in on this. Rick
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss