| Deutsch English Français Italiano |
|
<vdhqm7$2t1fi$3@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.roellig-ltd.de!news.mb-net.net!open-news-network.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: alt.folklore.computers,comp.os.linux.misc Subject: Re: Multiple Inheritance [was Re: The joy of FORTRAN] Date: Tue, 1 Oct 2024 21:47:52 -0000 (UTC) Organization: A noiseless patient Spider Lines: 61 Message-ID: <vdhqm7$2t1fi$3@dont-email.me> References: <pan$96411$d204da43$cc34bb91$1fe98651@linux.rocks> <5mqdnZuGq4lgwm_7nZ2dnZfqnPSdnZ2d@earthlink.com> <vcub5c$36h63$1@dont-email.me> <1r0e6u9.1tubjrt1kapeluN%snipeco.2@gmail.com> <vcuib9$37rge$5@dont-email.me> <vcvuhh$3hroa$2@dont-email.me> <llhieuF8ej2U2@mid.individual.net> <20240925083451.00003205@gmail.com> <Pascal-20240925164718@ram.dialup.fu-berlin.de> <mdd4j63pmo1.fsf_-_@panix5.panix.com> <oJ-cnQSrLZDYdGX7nZ2dnZfqnPWdnZ2d@earthlink.com> <vdatb6$1l4ch$8@dont-email.me> <vdauah$1lq1u$1@dont-email.me> <lltt6uF4fseU4@mid.individual.net> <vdcn1q$1tmdr$5@dont-email.me> <vddqoe$264fi$2@dont-email.me> <vdf4le$2cn51$6@dont-email.me> <vdh2l1$2p7e2$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 01 Oct 2024 23:47:52 +0200 (CEST) Injection-Info: dont-email.me; posting-host="45d68bef63035d0f49773effd7a1ab82"; logging-data="3048946"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lqIpuS0SelI713H+3K2Gw" User-Agent: Pan/0.160 (Toresk; ) Cancel-Lock: sha1:oSheFm6855XCxSbrXOOr/K4T1cE= Bytes: 4336 On Tue, 1 Oct 2024 15:57:36 +0100, Pancho wrote: > On 9/30/24 22:19, Lawrence D'Oliveiro wrote: > >> But it makes the difference between multiple inheritance that bewilders >> and confuses people, and multiple inheritance which makes sense. It’s >> what lets Python have multiple inheritance that makes sense. > > There is a difference between a consistent implementation of multiple > inheritance and something that people actually understand when coding, > or maintaining code. > > In essence just because you can do something clever, doesn't mean you > should. A clever idea worth using is one that saves programmer work and implementation overhead. For example, consider enumerated types. Java and C++ have to define these as part of the core language. But Python does not: enums are provided by a standard library module, written in pure Python -- there is nothing it does that you cannot do in your own Python code. This enum implementation is built on two important ideas from the core language -- multiple inheritance, and metaclasses -- in order to do its thing. As a result, it can do everything that Java enums can do, for example, and more besides. And the result is very easy to use: you don’t need to understand all the intricacies of the mechanisms concerned to define simple enums. (Want examples? Just ask.) >> Think about why languages like Java and PHP avoided multiple >> inheritance, and substituted those lame “interfaces” instead: it was to >> avoid this bewilderment and confusion that is known to plague C++, >> because the right solution wasn’t known at the time. >> > I quite like interfaces, polymorphism through interfaces. “Interfaces” are just “abstract base classes lite”. They are a way to provide a very limited form of multiple inheritance, in the hope that this would somehow avoid the bewilderment that comes from multiple inheritance as done in C++. Do they succeed? You yourself said “Single inheritance bewilders and confuses people”, so I don’t think they did. > I had a look, it would take me a while to work through the algorithm, > establish how the ideas sit in the more common language of DAGs and > graph theory. The gist of it is, the linearization algorithm from CLOS was refined a bit for Dylan. And C3 is in turn a refinement of the linearization used in Dylan. > If there is a significant difference that requires new > terms such as monotonic. “Monotonic” was not a new term in OO at the time of publication of that paper. In fact, the concept exposed some of the deficiencies that C3 sought to address.