# Extending Base methods with same name, completely different meaning?

**URL:** <https://discourse.julialang.org/t/extending-base-methods-with-same-name-completely-different-meaning/11082>\
**Category:** General Usage\
**Created:** [May 22, 2018, 8:15pm UTC](https://discourse.julialang.org/t/extending-base-methods-with-same-name-completely-different-meaning/11082 "2018-05-22T20:15:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![louisponet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/louisponet/32/2070_2.png) [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Post date:** [May 22, 2018, 8:15pm UTC](https://discourse.julialang.org/t/extending-base-methods-with-same-name-completely-different-meaning/11082/1 "2018-05-22T20:15:35Z")

</div>

There has been a lot of discussion recently, usually very deep and thorough/language designy, about the extension behaviour of methods. Now most of these discussions that I very loosely followed seem to address how the language should be designed for handling the various situations that might occur. Most of them did not lead to a clear conclusion yet I believe.

I am however usually facing the more concrete and trivial situation where I am naming a method like `position(atom::Atom)`, to then see an autocomplete suggestion `position(stream::IO)` pop up. I always wonder on whether I should then extend Base, or just encapsulate my method only inside the modules that I am using it in. While I think either way works, I’m more inclined to go with the latter. What are the general best practices for this? Or, could I get some feedback of more experienced developers/programmers on what their choice usually is?

offtopic: how can I add a tag that hasn’t been used before? If impossible, could we have a tag: `best practices`, `style guides` or something?

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [May 22, 2018, 8:42pm UTC](https://discourse.julialang.org/t/extending-base-methods-with-same-name-completely-different-meaning/11082/2 "2018-05-22T20:42:41Z")

</div>

I’d go with the latter.

---

<div class="post-metadata">

**Author:** ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Post date:** [May 22, 2018, 8:47pm UTC](https://discourse.julialang.org/t/extending-base-methods-with-same-name-completely-different-meaning/11082/3 "2018-05-22T20:47:59Z")

</div>

+1 defining the method within your module and not extending base.

---

<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:** [May 23, 2018, 8:46am UTC](https://discourse.julialang.org/t/extending-base-methods-with-same-name-completely-different-meaning/11082/4 "2018-05-23T08:46:37Z")

</div>

Introducing a distinct function or (abstract) type for a something that has disjoint meaning is a decision which I almost never regret. Naming is orthogonal, if the symbols for the right names clash, that’s what we have modules for.
