# Why "using" instead of "use"?

**URL:** <https://discourse.julialang.org/t/why-using-instead-of-use/7401>\
**Category:** General Usage\
**Created:** [November 30, 2017, 5:07am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401 "2017-11-30T05:07:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [November 30, 2017, 5:07am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/1 "2017-11-30T05:07:55Z")

</div>

Out of curiosity, when loading a module, why do we use `using Foo` instead of `use Foo`? I found this looks inconsistent because we use `import Foo` instead of `importing Foo`. Is there any implication here?

---

<div class="post-metadata">

**Author:** ![swt30](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swt30/32/4667_2.png) [@swt30](https://discourse.julialang.org/u/swt30)\
**Post date:** [November 30, 2017, 9:00am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/2 "2017-11-30T09:00:12Z")

</div>

A few potential but not very strong reasons:

- I think it comes from the C-esque “using namespace Foo”.
- They’re both a similar length… which looks nicer?
- `Using` is a very broad operation, basically merging the exported namespace of Foo with your current namespace. In my mind, the present continuous tense conveys this broadness. Now Foo is part of the rest of your code. Your code can look inside it to find names. You are accepting everything that it exports, for better or worse, and you are accepting it forevermore—well, at least until the end of the module.  
On the other hand, `import Foo` or `import Foo.Bar` is a more precise action: load in this specific thing under this name, which you can then refer to later. So it feels right, at least to me, that it uses the simple rather than the continuous tense.

Of course, this goes out the window when you can also do `using Foo: Bar`…

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [November 30, 2017, 10:41am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/3 "2017-11-30T10:41:22Z")

</div>

Yeah, it may come from C++.

All other keywords (`import`, `export`, `let`, `try`, `do`, `begin`, etc.) do not end with “ing”, so I thought there will be some meaning. I hope to see comments from historians of Julia.

---

<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:** [November 30, 2017, 11:08am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/4 "2017-11-30T11:08:53Z")

</div>

Is this historical curiosity, or do you propose that it is changed?

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [November 30, 2017, 11:21am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/5 "2017-11-30T11:21:06Z")

</div>

I assume there is some good reason to name it as `using`. But if no reason, I think we should rename it for consistency (hopefully before Julia 1.0).

---

<div class="post-metadata">

**Author:** ![jeff.bezanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff.bezanson/32/48_2.png) [@jeff.bezanson](https://discourse.julialang.org/u/jeff.bezanson)\
**Post date:** [December 2, 2017, 5:54pm UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/6 "2017-12-02T17:54:21Z")

</div>

Certainly not everybody loves the distinction between `import` and `using` (for multiple reasons), but I do think the difference in linguistic form is meaningful. `import` is an imperative action that happens once. It brings in a name up front, and then it’s done. The effect of `using` happens over time — it says “I will generally be using this package”, with names resolved from it on demand. The C++ precedent contributes as well.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [December 2, 2017, 5:58pm UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/7 "2017-12-02T17:58:31Z")

</div>

What you say is quite meaningful, thanks for the explanation.

By the way, I wonder what you think of the explicit export from modules ([Is an explicit "export" a good thing? - #35 by PetrKryslUCSD](https://discourse.julialang.org/t/is-an-explicit-export-a-good-thing/7446/35))?

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [December 3, 2017, 4:35am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401/8 "2017-12-03T04:35:05Z")

</div>

Thank you for your reply. That sounds reasonable to me, though I don’t strongly agree with it.
