# 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:** 148

<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:** [January 1, 2021, 6:20am UTC](https://discourse.julialang.org/t/is-julias-way-of-oop-superior-to-c-python-why-julia-doesnt-use-class-based-oop/52058/148 "2021-01-01T06:20:56Z")

</div>

> [@ChrisRackauckas](#):
>
> Both are sampling points according to a distribution, one is just implicitly defined and the other is explicitly defined.

Sure, but the signatures are so different that with the current design, it is very unlikely that one could use `sample` in generic code, like `+`. Which is what you would expect, as StatsBase’s is `sample` methods are low-level utility functions, while in Turing they are part of the high-level API.

Note that I don’t indend to single out Turing here — other packages do similar things, and I have done this myself. The idea that recycling a symbol for a completely different, non-conflicting signature [may not be a good design for Julia](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335/) evolved with practice and I think is a good principle to follow.

---

_[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)._
