# Multiple Parent Types: How to go about it?

**URL:** https://discourse.julialang.org/t/multiple-parent-types-how-to-go-about-it/66493
**Category:** General Usage
**Tags:** question, inheritance
**Created:** [August 16, 2021, 3:15pm UTC](https://discourse.julialang.org/t/multiple-parent-types-how-to-go-about-it/66493 "2021-08-16T15:15:45Z")
**Posts on this page:** 4
**Page:** 2

<div class="post-metadata">

### Author: ![bgroenks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bgroenks/32/21784_2.png) [@bgroenks](https://discourse.julialang.org/u/bgroenks)
#### Post date: [August 24, 2021, 8:56am UTC](https://discourse.julialang.org/t/multiple-parent-types-how-to-go-about-it/66493/21 "2021-08-24T08:56:28Z")

</div>

Multiple inheritance is neither necessary nor desirable. It is a construct which sounds nice in principle but almost always results in poor software design and unnecessary complexity. The Julia community’s preference for composition and Julia’s pseudo-traits is very much in line with the opinions of the broader software engineering and programming language theory communities.

I would much prefer that the Julia developers spend their very valuable time on more important issues, such as compiler latency, or more useful features, such as first-class traits (as opposed to the current “Holy trait trick”).

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [August 24, 2021, 9:05am UTC](https://discourse.julialang.org/t/multiple-parent-types-how-to-go-about-it/66493/22 "2021-08-24T09:05:16Z")

</div>

You’ve missed the point of issue #5. Traits are a kind of multiple inheritance of behavior, which is seperate from inheritance of structure. The comment I linked to includes an overview about traits.

That is, advocating for better traits _is advocating for a certain kind of multiple inheritance_.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [August 24, 2021, 9:29am UTC](https://discourse.julialang.org/t/multiple-parent-types-how-to-go-about-it/66493/23 "2021-08-24T09:29:55Z")

</div>

This has been addressed in some of the discussions linked above, but maybe it helps to reiterate that

1. Julia does not have “inheritance” of _fields_, either single or multiple, and probably never will.

2. Types have supertypes. Supertypes are always _abstract_. This is useful for dispatch, mostly, and it should be thought of as a convenience feature that could be implemented with eg traits if we didn’t have it.

3. Traits are a special case of type stable mappings that allow implementing multiple supertype-like relations, among other things. But they are much more general than that, and mesh well with how Julia works.

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [August 27, 2021, 3:57pm UTC](https://discourse.julialang.org/t/multiple-parent-types-how-to-go-about-it/66493/24 "2021-08-27T15:57:52Z")

</div>

11 posts were split to a new topic: [Deep dive detangling terms: multiple inheritance vs. traits](https://discourse.julialang.org/t/deep-dive-detangling-terms-multiple-inheritance-vs-traits/67110)

[Previous page](https://discourse.julialang.org/t/multiple-parent-types-how-to-go-about-it/66493.md?page=1)
