[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Curl, multiple inheritance, and interfaces (was Re: cheerful static typing)
> Christopher Barber wrote:
> > - Curl supports multiple inheritance
> > (and thus has no need for interfaces)
>
> Does Curl have some other way of declaring a contract independently from a
> specific implementation of that contract?
No.
> If not, then I would argue that
> there is still a need for interfaces (or an equivalent), despite the
> existence of multiple inheritance.
> Although it's possible, e.g. in C++, to use abstract classes and multiple
> inheritance to achieve the functionality of interfaces, in practice it's
> very useful to have an explicit language construct that supports this. My
> experience with Java indicates that it helps programmers think
> more clearly
> about these issues.
That may be true, but I rather doubt that they would have bothered to
introduce the extra complexity of interfaces if they had retained full
multiple inheritance.
However, we have considered adding such a feature, but have not deemed it
important enough to schedule it ahead of the many other things we are trying
to do.
> Of course, in many of the little/scripting languages, supporting
> explicitly
> declared interfaces might be considered counter to their design
> principles,
> although I believe a more rigorous approach is possible on an optional
> basis. Curl seems to be taking this approach in other areas - if it's not
> doing so with interfaces, why not?
Simply because we don't have time to design and implement everything that
could be useful!
- Christopher