Re: python interfaces



Sion Arrowsmith wrote:
hyperboreean <hyperboreean@xxxxxxxxxxxxx> wrote:
Why doesn't python provide interfaces trough its standard library?

Because they're pointless.

Wrong. I'm using Eclipse with the Java Development Tools (JDT) who do
a wonderful job using interfaces to perform lots of checking, warning
and code generation *nearly in real time while I am editing my code*.
Because JDT knows interfaces it knows what to do and to suggest. An
interface is a software specification allowing you to use a software
package without extensive code studies. This is a good thing.

> Java interfaces are a hack around the complexities of multiple
> inheritence.

A hack is something applied subsequently to solve a software problem while
avoiding large changes. Java interfaces originate from careful language
design. You are free to dislike Java interfaces but calling them a hack is
just plain wrong.

Once software becomes really big interfaces are very useful to handle
complexity. Ever wondered why the Zope people introduced interfaces in
their Python code?

> Interfaces used purely with the idea of type safety provide
> precious little gain for the added clutter and inconvenience.

An interface is a software specification allowing you to use a software
package without extensive code studies. This is a good thing. Interfaces
have nothing to do with multiple inheritance. They just tell you how to
connect, how to plug in.

--
Regards/Gruesse,

Peter Maas, Aachen
E-mail 'cGV0ZXIubWFhc0B1dGlsb2cuZGU=\n'.decode('base64')
.



Relevant Pages

  • Re: 7.0-BETA2 routed and multicast registration
    ... We can put a nice big comment in that says "this is an old crusty hack, it is NOT SUPPORTED for new code", but it's better not to have kludges there in the first place. ... :-) At this point, in the interest of shipping working apps, it's sounding like we may need to re-add the interfaces to 7.x with clear deprecation markings. ... It gives special meaning to the first eight bits of an IPv4 address which happen to be zero. ...
    (freebsd-current)
  • Re: why is multiple inheritance not implemented in java?
    ... Granted, most Java interfaces I've ever met where relatively small, but still. ... I'm just not a fan of saying "Interfaces are a replacement of multiple inheritance" or the like. ... Using the Java way of interfaces alleviates that pain for the most part, but occasionally you have to work around it. ...
    (comp.lang.java.programmer)
  • Re: Delphi to C#?
    ... If the new generics are just a cheap ... hack to make these look less ugly they might come with lots of crazy ... for COM' is a bit crazy. ... to keep the functionality as simple as possible in the COM interfaces I have implemented. ...
    (borland.public.delphi.non-technical)
  • Re: Statically AND Dynamically Typed Language ??
    ... Common Lisp does this. ... This is why Python or Lisp don't have interfaces, ... multiple inheritance without getting into the mess that C++ made of it ... But they're only a hack to the type ...
    (comp.lang.misc)
  • RE: Definition of interfaces in ifconfig
    ... > questions about the interfaces on freebsd-questions. ... > wouldn't recommend you just hack into it without knowing what you're ...
    (freebsd-newbies)