# To include types and functions or to use modules?

**URL:** <https://discourse.julialang.org/t/to-include-types-and-functions-or-to-use-modules/9502>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 5, 2018, 10:47am UTC](https://discourse.julialang.org/t/to-include-types-and-functions-or-to-use-modules/9502 "2018-03-05T10:47:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [March 5, 2018, 2:55pm UTC](https://discourse.julialang.org/t/to-include-types-and-functions-or-to-use-modules/9502/2 "2018-03-05T14:55:08Z")

</div>

If the only place that those units are used are within your (main)module, then you are probably fine without making it into a module, since now instead of one statement of `include("unit.jl")` you now have multiple statements to just accomplish the same task:

```julia
include("unit.jl")
using Unit

```

which is more convoluted, if it is not needed.

However, if you have a very cluttered namespace, then it might be of advantage to indeed place it into its own module and use the `using` syntax. Then when you call `using`, all of the functions that are not `export`ed will now be hidden and tucked away. So it depends on whether you experience conflicts, but this also requires you to put more effort into determining what functions need `export` statements and how to manage.

So putting it into a module is a tradeoff that adds a bit of extra maintenance to your package work, which might be unnecessary if it is not needed due to namespace issues within the scopes you intend to use it for.

This question is somewhat similar to

> [@Package size and scope?](https://discourse.julialang.org/t/package-size-and-scope/7309):
>
> Hi All – Recently started developing packages. Was wondering how everyone feels about package size and scope. Do you feel like there is a minimum or maximum size/scope a package should be? As a Developer: Do you include just a few things in a package (and do them well)? Or do you put in everything but the kitchen sink? As a User: Do you include a package with 10 functions to just use 1 of them? Or do you not want to be bothered with a la carte packages? For context, (and a tad less b…

---

_[View the full topic](https://discourse.julialang.org/t/to-include-types-and-functions-or-to-use-modules/9502)._
