# Function name conflict: ADL / function merging?

**URL:** <https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335>\
**Category:** Internals & Design\
**Tags:** proposal, namespaces\
**Created:** [April 14, 2018, 5:16pm UTC](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335 "2018-04-14T17:16:17Z")\
**Posts on this page:** 1\
**Showing post:** 132

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [April 19, 2018, 9:14am UTC](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335/132 "2018-04-19T09:14:58Z")

</div>

Thank you for the C++ example, I think it’s a helpful way to discuss this problem.

So the `main` function would of course live in an implementation (`.cpp`) file as opposed to a header file. Now while not everybody in C++ land agrees whether having `using` directives in implementation files is a good idea, there really seems to be a consensus that having `using` directives in header files is very bad style:

- C++ core guidelines (Stroustrup and Sutter), [https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-using-directive](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-using-directive) - “Don’t write using namespace in a header file.”
- GNU, libstdc++ manual, [Namespaces](https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_namespaces.html) - “This approach works well for individual source files, but should not be used in a global context, like header files.”
- Google style guide, [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html#Namespaces) - “Do not use using-directives (e.g. using namespace foo).”

In Julia, there is (thankfully, in my opinion) no distinction between a header file and an implementation file. So in effect, every file is a header file (as well as an implementation file), and thus C++ best practice would have it that use of the Julia equivalent of `using namespace` statements should be avoided.

Now that doesn’t necessarily mean that Julia’s `using` should currently be avoided if you believe that these C++ best practices are worth adhering to; Julia’s `using` is not exactly the same as C++'s `using namespace`. But if the type of behavior in your `main` function were to happen in Julia code as a result of `using MyModule; using MyModule2`, then I _would_ think that this hypothetical version of Julia’s `using` is sufficiently similar to C++'s `using namespace` for the C++ best practice rule to apply.

Edit: I reread your post more thoroughly, and I think the second example (without the `using namespace` statements, i.e. [argument-dependent lookup](https://en.wikipedia.org/wiki/Argument-dependent_name_lookup)) is actually very interesting though. _This_ may be where there could be some space for Julia to be improved.

---

_[View the full topic](https://discourse.julialang.org/t/function-name-conflict-adl-function-merging/10335)._
