# Excessive namespace using @reexport

**URL:** <https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823>\
**Category:** General Usage\
**Tags:** question, namespaces\
**Created:** [March 9, 2021, 4:45pm UTC](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823 "2021-03-09T16:45:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [March 9, 2021, 4:45pm UTC](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823/1 "2021-03-09T16:45:48Z")

</div>

Hi,

I’m writing a module that makes use of the `Distributions` package. Its API has arguments that are `Distribution` types. So in order to be used in another environment, it is practically mandatory that the Distributions package is loaded too.

So what I did was to add a `@reexport using Distributions` at the beginning of my module to ensure the user have all it needs when it loads my package with `using MyPackage`.

Is this a good practice ? I’m asking because it’s crowding the namespace of `MyPackage` with all the exported names of `Distributions`, most of which are useless. And I’m kind of suspecting that this is not the intended use of Reexport, that it’s rather made for sub-modules.

If it’s not, what’s the advised way to go then ?

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [March 9, 2021, 8:49pm UTC](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823/2 "2021-03-09T20:49:41Z")

</div>

Do you also have functions which do not need `Distributions` at all? I guess it depends a bit on the expected use-case. I would personally try to limit the cluttering on the namespace as much as possible, but also know that others don’t see it as an issue.

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [March 9, 2021, 9:23pm UTC](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823/3 "2021-03-09T21:23:24Z")

</div>

Yes, most of them actually. Basically Distributions are needed in the constructors of the structs provided by the package, but once they are instantiated, you interact with them without the need for Doistributions anymore.

---

<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:** [March 11, 2021, 1:07pm UTC](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823/4 "2021-03-11T13:07:18Z")

</div>

I would _not_ reexport anything, and just document that users should be

```julia
using Distributions, MyPackage

```
