Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not a ruby guy but ruby has mixins which fill the same niche (even if they probably behave a little differently to accomplish it).

Mixins don't even compare to roles; mixins in Ruby (at least Ruby 1.8 this was true) manipulate inheritance, and so they suffer from ordering problems. The compiler can't warn you about collisions and conflicts.

Roles solve that problem.



>Mixins don't even compare to roles;

Of course they do. They may not be as good as perl's Roles but you can't say "Ruby doesn't even have a way to do this" as the GP did (paraphrased). They do, perhaps it's not as nice but it's there.


One of the explicit design goals for roles was to solve the flaws of mixins. We succeeded. While it may be technically correct to object to a hyperliteral interpretation of an English idiom, I stand by the assertion that the presence of roles in Perl 5's Moose and Perl 6's object system makes for a better object system than Ruby with mixins.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: