in reply to Informal Poll: why aren't you using traits?
Adding roles to an introspective OO language that supports aliasing, like Ruby, isn't hard. I may do that for Ruby, now that I'm thinking about it. Ruby's traits.rb isn't Traits, it's a better version of attribute declarations. So, maybe I should call it roles.rb.
Adding it to Perl, however, is way too complicated. Writing Perl6::Roles was a pain in my butt. Not because the code was hard, but because I had to write so much scaffolding and assume so much about how things worked that it made my head hurt. And, that was with punting a whole lot to the user. That's why it's so limited in what it does. There is no attributes, not expectations, or anything. The free-for-all that is Perl's OO actually makes things worse than better.
As for your question - I would gladly use traits/roles/whatever-they're-called-this-week. But, only if they were well-defined. Right now, as Zaxo said, they're an experimental concept. For example:
Yes, I know a lot of those questions have answers. stvn has done a lot of work in Class::Traits, in his work on the Perl6 metamodel, and in helping me write Perl6::Roles. In all that, he's come up with some darn good answers to a bunch of those questions. That doesn't mean that his answers are complete. And, frankly, his answers may be wrong for some situations.
(Note: stvn doesn't use traits in his production work ... maybe that's a sign that traits aren't ready for primetime.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Informal Poll: why aren't you using traits?
by stvn (Monsignor) on Nov 19, 2005 at 17:22 UTC | |
by Ovid (Cardinal) on Nov 19, 2005 at 20:34 UTC |