From: Marc Heiler Date: 2012-11-06T02:44:18+09:00 Subject: Re: Support for multiple Inheritance by classes > If you really want a Ruby-like language with multiple > inheritance, might I suggest Python? What I do not understand is why people suggest other languages. It is not as simple. Python uses so many different ways, it has a completely different philosophy, so suggesting to use another language A because you do not like one component in language B isn't any real improvement. Via modules in ruby you can get quite close to what multiple inheritance solves. There is no need to go to python at all. Ruby and Python are way too similar in their ecological niche as well. There is one thing that is however not looked at much at all in this discussion - less the distinction between multiple inheritance vs. module mixins, and much more so what the distinction class vs. module actually serves. Because I often feel that the distinction between classes and modules is much more arbitrary than seems to be reasonable. You have a class Foo, and you mixin three different modules into it. That is quite close to what multiple inheritance does too, just not following the classical subclassing tree. But why is that behaviour contained within a module? Why could we not assume that ALL behaviour of every object resides in an (perhaps invisible) module? Then we could use classes the same way as modules. module Foo end module Bar include Foo end vs. class Foo end class Bar < Foo end To me this is a distinction in Ruby that I do not really feel is compelling at all. I have seen people use class Foo module Bar end end And I asked them why they did it that way, and they told me that the toplevel class gives them more features, namely the ability to do Foo.new, than it would by using a module. That baffled me when I heard it. My question thus is: Why must there be this distinction between classes and modules in this way? -- Posted via http://www.ruby-forum.com/.