From: Matthew Kerwin Date: 2012-04-21T09:12:37+09:00 Subject: Re: Why must I know whether I extend a class or a module? On 20 April 2012 13:53, Intransition wrote: > The forced distinction only serves to take that flexibility away from the > programmer. Is there not overhead associated with that distinction? I haven't actually looked into it, but I'd assume that Modules are a lot more light-weight than Classes, because of the things that can't be done with them. > There are other benefits too in that removing the distinction would allow > auto instantiation, e.g. > >     class Foo::Bar >     end > > Would work just fine, even though no `Foo` has been defined separately. This > can be especially nice when requiring sub-files. I can see that this would be convenient, but it also makes me cringe. You're defining a namespace Foo without ever explicitly defining it. Why? What's its purpose? How and where is it documented? I can't make my gut instinct accept this as anything but a bad idea. --   Matthew Kerwin, B.Sc (CompSci) (Hons)   http://matthew.kerwin.net.au/   ABN: 59-013-727-651   "You'll never find a programming language that frees   you from the burden of clarifying your ideas." - xkcd