Context
I've recently came across this C# proposal default interface methods I've read both the specification and more importantly the motivation. Possibly I missed something, but the motivation is a bit stinks me.
The only practical difference between interface and a fully abstract class was that a future class can implement (so be [IS A]) multiple interfaces, but can inherit (so be [IS A]) from only one abstract class, (and all the consequences)
What is not clear for me what is the exact difference between abstract classes and interfaces with default methods now, except that we can bring multiple (implementation) inheritance into the picture with default methods, which is not possible with abstract classes. (I do not want open the question/discussion is it good or bad, this is not the topic here)
However the motivation talks about completely different, three points:
- "...API author to add methods to an interface in future versions without breaking source...". Well an "API" author can add methods to an abstract class also in a future version if he implements them without breaking anything.
- "...enables C# to interoperate with APIs targeting Android (Java) and iOS (Swift),...". I think a language design decision, especially about abstractions and OOP patterns like multiple inheritance is a bit higher level than interoperate with Swift. I also think, this is only the 0.0x percent of interoperation issues, and also can be solved with other ways.
- "...As it turns out, adding default interface implementations provides the elements of the "traits" language feature...". This is a very shallow statement, especially it refers to wikipedia "traits". By definition, traits allow adding methods without multiple inheritance (having [IS A] relationship with a super). However interfaces definitely are about [IS A]... Not talking about the fact, that traits are at least arguable good practice
Question
My question is what is the real difference (or motivation), or what am I missing?