(Map|Set|WeakMap)#set() returns `this` ?

Andrea Giammarchi andrea.giammarchi at gmail.com
Wed Dec 5 12:13:47 PST 2012


I think here you have more libraries authors than users, with daily basis
tasks to solve without jQuery and others ... that's why here things are
different from "out there", is not about knowing more or anything, IMHO.

Said that, since as I have written "no pattern blocks anyone to reach same
goals inline" I don't even feel that strong about it, I am just saying what
would be the ideal scenario in my opinion, wondering initially why it has
been chosen a different one.

I am happy to read that I wasn't the only one preferring the value instead
of `this` so ... mine was just a summary for CC'ed people and nothing else.

All I would like to believe is that these discussions are performed more
often in this ML and before Meeting Notes so you have more material there
before making decisions.

Br


On Wed, Dec 5, 2012 at 11:57 AM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:

> On Wed, Dec 5, 2012 at 10:04 AM, Mark S. Miller <erights at google.com>
> wrote:
> > On Wed, Dec 5, 2012 at 1:50 AM, Jussi Kalliokoski
> > <jussi.kalliokoski at 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.
>
> The readability of chaining *is* very subjective.  I find it perfectly
> readable.
>
> Andrea and a few others feel strongly about this, and I respect that.
> But most JS libraries have gone the other way, and authors in general
> seem to like that direction.  This constitutes pretty clear evidence
> about which pattern JS devs en masse prefer, and we shouldn't pretend
> like we know better than them.  In the absence of technical problems
> that doom a solution, let's vote with the herd.
>
> ~TJ
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121205/fe36648a/attachment.html>


More information about the es-discuss mailing list