# Is Julia's way of OOP superior to C++/Python? Why Julia doesn't use class-based OOP?

**URL:** <https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058>\
**Category:** Internals & Design\
**Created:** [December 18, 2020, 4:32pm UTC](https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058 "2020-12-18T16:32:10Z")\
**Posts on this page:** 1\
**Showing post:** 137

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [December 28, 2020, 12:33am UTC](https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058/137 "2020-12-28T00:33:06Z")

</div>

This is a nice example @Elrod. This is one of the situations where it’d be quite handy to be able to make `Foo{T} <: T`. The other ones I’m aware of off the top of my head are

- Symbolic types: when making a symbolic programming system that models julia code, it’d be really nice if you could have say `Symbolic{Integer} <: Integer` and `Symbolic{DenseArray} <: DenseArray`.
- Autodiff: in automatic differentiation via operator overloading, you want a `Dual{T} <: T` so that you make sure you go down the right code-pathways for e.g. `Real` versus `Complex` primals.

A trait based approach would be quite nice for this.

---

_[View the full topic](https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058)._
