From: David Masover Date: 2010-07-20T13:03:12+09:00 Subject: Re: ruby abstraction On Sunday, July 18, 2010 02:35:03 am Robert Klemme wrote: > On 07/18/2010 06:53 AM, David Masover wrote: > > On Saturday, July 17, 2010 08:21:10 pm James O'Brien wrote: > >> as a thought-experiment I > >> propose Java without interfaces would be worse > > > > Probably. > > You could not have Java without interfaces. You would at least have to > drop static typing and this would be a major change to the language. I > don't think you would still call the result of this operation "Java". I don't think so. It would be much like Java without Generics -- frustrating to work with, but possible. Basically, it kills any sort of polymorphism between things which don't share a common ancestor -- so you make more use of inheritance in some situations (take Collections, it wouldn't be so bad if we had to inherit from AbstractCollection, AbstractList, etc), and aggressively abuse modular decomposition (anywhere you have one object that needs to pretend to be two types, make two related objects!), and you could make it work. In fact, IIRC, this is how C++ does it -- it's just made much easier due to multiple inheritance. I never quite understood why Java allows multiple interfaces to be applied to the same object, and even to the same interface, but not multiple inheritance. I'm not suggesting this would be a good idea, mind you -- but then, I'm also not entirely sure either Java or C++ is a good idea.