Andrea Giammarchi (2015-02-12T20:22:09.000Z)
`Object.assign` is good only to define defaults properties, since it does
not even understand getters and setters, it's really a poor option for
anything trait related.

`Object.assign` is an ES6 introduction based on ES3 assumptions, not even
sure why someone would consider it for traits.

Moreover, initialization on `new ClassWithTraits` is something we'll
eventually have to agree about, and here `assign` is poor indeed as Domenic
said already.

On top of that, `instanceof SomeTrait` makes again no sense to me, 'cause
that's **class** related and not behavior related, hence my idea that
classes as traits are somehow misleading, confusing, or a mistake.

These two cannot be the same, otherwise we need to agree on which one is
redundant ( and I already have an idea which one, now flagship of the
incoming standard, would loose "the competition" )




On Thu, Feb 12, 2015 at 9:08 PM, Benjamin Gruenbaum <inglor at gmail.com>
wrote:

> Why does ES even need traits?
> The only aspect they can help with here is the type system we don't have
> yet.
>
> We have `Object.assign` that works fantastically for most classic trait
> use cases.
>
> > On Feb 12, 2015, at 18:35, Andrea Giammarchi <
> andrea.giammarchi at gmail.com> wrote:
> >
> > Without going down full specification/implementation details, does
> anyone believe that classes should/could be used, in the future, as
> traits/mixins too?
> >
> > I find that an anty pattern.
> >
> > I think traits should be just plain objects with an initializer or some
> special object flagged as trait and I'd rather leave inheritance and
> classes features outside this future feature.
> >
> > Thoughts? Thanks!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150212/f01f7166/attachment.html>
d at domenic.me (2015-02-17T20:25:17.542Z)
`Object.assign` is good only to define defaults properties, since it does
not even understand getters and setters, it's really a poor option for
anything trait related.

`Object.assign` is an ES6 introduction based on ES3 assumptions, not even
sure why someone would consider it for traits.

Moreover, initialization on `new ClassWithTraits` is something we'll
eventually have to agree about, and here `assign` is poor indeed as Domenic
said already.

On top of that, `instanceof SomeTrait` makes again no sense to me, 'cause
that's **class** related and not behavior related, hence my idea that
classes as traits are somehow misleading, confusing, or a mistake.

These two cannot be the same, otherwise we need to agree on which one is
redundant ( and I already have an idea which one, now flagship of the
incoming standard, would loose "the competition" )