# Recommended style guide for naming functions is not practical

**URL:** <https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206>\
**Category:** General Usage\
**Created:** [February 26, 2019, 9:32am UTC](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206 "2019-02-26T09:32:39Z")\
**Posts on this page:** 6\
**Page:** 2

<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:** [February 26, 2019, 4:57pm UTC](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206/21 "2019-02-26T16:57:45Z")

</div>

> [@essenciary](#):
>
> Actually, that’s what I’m doing as I’m “migrating” the API: `const foobar = foo_bar` .

Without knowing the details, I would hazard a guess that something like the `@deprecate` macro would be more appropriate.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [February 26, 2019, 5:03pm UTC](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206/22 "2019-02-26T17:03:38Z")

</div>

> [@essenciary](#):
>
> Maybe my Atom editor is not properly configured, but no, I don’t automatically get anything. For example, creating a new .jl file and typing `printst` triggers no autocomplete and `printst\TAB` results in a TAB being appended (so no `printstyled` completed). If you have a better configuration, please share.

If by Atom you mean Juno then you definitely should get an autocompletion dropdown as soon as you type and have a Julia session running:  
 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/8/d/8d52dfa39e79e6971c05c01e440a855103c51d9a.png)

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2019, 5:10pm UTC](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206/23 "2019-02-26T17:10:23Z")

</div>

The idea is that currently the user access `foo_bar` - but I’d like to swap them to `foobar` across a few minor versions. So first, I need to provide the corresponding methods to allow users to update their code. And then deprecate by making `foobar` the actual name of the function and have `foo_bar` as `foo_bar() = deprecation_message() && foobar()`. Where `deprecation_message` will let them know that they need to switch from `foo_bar` to `foobar`.

It might be a good case for `@deprecate` but I’m not sure how to use it. Is it documented, I can’t seem to find it.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2019, 5:14pm UTC](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206/24 "2019-02-26T17:14:18Z")

</div>

Ah, you’re right about the “have a Julia session running” part! I just tested and indeed, it now works. I don’t normally (ever?) use the REPL in Atom as my work is in the browser, so I just edit files in Atom and check the webpage.

---

<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:** [February 26, 2019, 5:17pm UTC](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206/25 "2019-02-26T17:17:08Z")

</div>

> [@essenciary](#):
>
> Is it documented, I can’t seem to find it.

It has a docstring, and `Base` is full of examples.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [February 26, 2019, 5:18pm UTC](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206/26 "2019-02-26T17:18:59Z")

</div>

Good point, thanks.

```julia
help?> @deprecate
  @deprecate old new

  The first argument old is the signature of the deprecated method, the second one new is the call which replaces
  it. @deprecate exports the function.

```

I need to try it.

[Previous page](https://discourse.julialang.org/t/recommended-style-guide-for-naming-functions-is-not-practical/21206.md?page=1)
