This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Traits? Nah
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
...nobody who uses Seaside in production is seriously proposing that we make it depend on Traits - as far as I know, nobody uses Traits in production, period.
Ouch.
To be fair, there are a couple people who apparently do use traits in the Smalltalk world, but very few. When I searched the comp.lang.smalltalk archives I found 47 hits, all of which were more or less academic conversations on traits, their possible use and their potential usefulness, but no actual use cases. I honestly can't tell if, among those that like the idea, they want traits merely for the mixin capability or for the honest to goodness composition.
That, of course, makes me wonder why they decided to implement traits (aka roles) in Perl 6 without any real community feedback or use cases. There's no discussion on comp.lang.perl.misc about them. Only members of the Perl 6 core team seem to be excited by them as far as I can tell. Others either don't seem to know about them or are nonplussed.
I mean, given that the concept of traits have been around for 4 years now, and even Smalltalkers can't find a use for them, don't you have to wonder if they're really worth it?
In any case, my feeling (these days) is that the interface aspect of traits should only be used in static languages, such as Scala, which lacks any other sort of mixin mechanism (that I'm aware of). Enforcing that element in a dynamic language amounts to a form of static typing, and with the same result - you'll end up with brittle code.
As for the multi-mixin "problem" in Ruby, well, that was solved here.