# Function naming (clash, convention)

**URL:** https://discourse.julialang.org/t/function-naming-clash-convention/1617
**Category:** New to Julia
**Created:** [January 20, 2017, 4:50pm UTC](https://discourse.julialang.org/t/function-naming-clash-convention/1617 "2017-01-20T16:50:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![swissr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swissr/32/208_2.png) [@swissr](https://discourse.julialang.org/u/swissr)
#### Post date: [January 20, 2017, 4:50pm UTC](https://discourse.julialang.org/t/function-naming-clash-convention/1617/1 "2017-01-20T16:50:54Z")

</div>

I’m reviewing a package and there is a function called `VaR` (Value-at-risk).

Acc. to the conventions I’d propose to make it all lowercase. But then `var` clashes with the `Base.var` function and gives a warning when calling the function. What are my options now?

Iiuc I cannot use (and export) `var` in a user package without having warnings. The name `VaR` seems too much non-standard. Using qualified calls, `MyPkg.var`, would be an option. Import ‘var’ and redefine it would be another option (but I think it’s not a good idea to redefine functions with a completely different behaviour?). I suppose, using a non-abbreviated name, e.g. `value_at_risk`, would be the best choice.

Opinions? What are you doing in such a situation? I think it should be quite common that short abbreviated function names clash with names in Base (or, less bad, other packages).

---

<div class="post-metadata">

### Author: ![johnmyleswhite](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnmyleswhite/32/31_2.png) [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)
#### Post date: [January 20, 2017, 4:57pm UTC](https://discourse.julialang.org/t/function-naming-clash-convention/1617/2 "2017-01-20T16:57:48Z")

</div>

Don’t export this name and use `YourPkg.var`. This is exactly the solution that we’ve settled on for things like `gradient` and `parse`.

---

<div class="post-metadata">

### Author: ![Pbellive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbellive/32/3604_2.png) [@Pbellive](https://discourse.julialang.org/u/Pbellive)
#### Post date: [January 20, 2017, 9:45pm UTC](https://discourse.julialang.org/t/function-naming-clash-convention/1617/3 "2017-01-20T21:45:54Z")

</div>

To throw my two cents in, I think @johnmyleswhite’s suggestion is the way to go if you’re intent on keeping the name `var` or if `var` really is the most descriptive name for your function. In your case, `value_at_risk` seems to be a much more descriptive name that doesn’t conflict with anything in `Base`. Using descriptive names usually the best way to go. Unless `var` is standard terminology in your field.

---

<div class="post-metadata">

### Author: ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)
#### Post date: [January 21, 2017, 3:17pm UTC](https://discourse.julialang.org/t/function-naming-clash-convention/1617/4 "2017-01-21T15:17:10Z")

</div>

Call the function valueatrisk?
