Daniel Berger isn't keen on the future of traits.
Okay, so I'm the Perl 6 designer most excited by them (and the one most to blame for them, though that's only by plurality of blame and not majority), but I've used them and they've solved real problems in my code with regard to duplication, typing, and genericity.
I suspect the users of Class::Trait have similar stories.
Don't get me wrong; I'm not down on duck typing in general. I think static, inheritance-heavy hierarchies tend to lead to bad designs. Yet there is a very real false cognate problem with duck typing and there are better ways to bundle and re-use code with cross-cutting concerns than mixins and monkeypatching.
I suspect though that languages which make doing the wrong thing both easy and syntactically attractive (yes, Smalltalk and Ruby) lead to subtler forms of technical debt in the form of near-duplication and potential fragility.
(Of course, if you always think of objects and classes in terms of objects and classes and not verbs bundled under appropriate adjectives, you make different design decisions. Hm, I almost made it through this entry without using the word "allomorphism".)
Smalltalk Traits (Score:2)
Daniel makes this comment in relation to someone on a Smalltalk mailing list mentioning that they didn't know of anyone using traits in production. Admittedly, this was Avi Bryant, the developer of Seaside, but still, let's think about it. The Smalltalk community is a much smaller community than Perl. In the Perl community, we have some relatively well-known people evangelizing traits -- yourself, Stevan Little (to an extent) and myself, to name a few -- and we have routinely written blog entries, articl
Re: (Score:1)
Plenty of OO programmers who really ought to know better think that inheritance is The Important Point of OO [oreillynet.com].
In the interests of better software, I give everyone reading this permission to slap anyone who talks that way in apparent seriousness.
FWIW (Score:1)
http://code.enthought.com/traits/ [enthought.com]
Re:Not sure if that is the same traits (Score:1)
I have looked over this one a couple of times, and I am still not sure it is really related to the Smalltalk Traits which chromatic is talking about. There might be some similarities, but beyond that I am not sure.
- StevanRe: (Score:1)
Funny; I almost posted the same thing. It looks similar in a familiar way, but I don't understand it well enough to say "Yep, that's it!"
Re: (Score:1)
And Moose::Role too (Score:1)
There has been a recent boost in role usage in the Moose community, so I suspect we will have some stories as well. I have submitted a roles talk to YAPC::EU, which takes a "how roles can solve problems in the real world" approach and I think provides a pretty compelling use case (based on actual experince using roles in a production system).
- Stevan... and what did Alan Kay think? (Score:2)