# The current state of function naming style

**URL:** <https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849>\
**Category:** General Usage\
**Tags:** function, style\
**Created:** [April 24, 2026, 11:33am UTC](https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849 "2026-04-24T11:33:10Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![gwr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gwr/32/225059_2.png) [@gwr](https://discourse.julialang.org/u/gwr)\
**Post date:** [April 30, 2026, 6:23pm UTC](https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849/21 "2026-04-30T18:23:24Z")

</div>

> [@juliohm](#):
>
> `required_action_to_take(args...)`

In my opinion, I am still fresh to Julia, it would be ontological mismatch to juxtapose “required\_action” with “perform”, because “required\_action\_to\_take” is semantically different from “performing\_required\_action\_to\_take”.

So if we have `perform_a(b)` and `perform(b, a)`, the latter of which looks like your kind of generalization, then `perform_a` signals that `_a` is an invariant and will not be used for dispatch at all.

My understanding of Julia so far is that this is useful to make internal, unexported functions more readable for humans: “read\_file(path)” or “parse\_from\_left(text)”.

When `a` has state that’s important as in your “required\_action\_to\_take”, then I see the value of your style. But to me it would look like over-engineering to make everything a type for dispatch, e.g. `parse(text, :left)`. Note that the snake casing has just moved to the “object name” because we would probably have `parse(text, :from_left)`.

If your style degenerates to something like

```julia
perform(args…, method)

```

It starts looking a bit like single dispatch to me, where method is the object owning the function.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [April 30, 2026, 8:31pm UTC](https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849/23 "2026-04-30T20:31:12Z")

</div>

> [@gwr](#):
>
> “required\_action” with “perform”, because “required\_action\_to\_take” is semantically different from “performing\_required\_action\_to\_take”.

That was just an example. I tried to convey the message that it is always possible to take a long function name and rethink a design where the args and kwargs become fields of a `Method` struct in CamelCase. The number of verbs is reduced to a more intuitive/clean API in my personal experience.

Of course people are free to mix code styles as they wish. I am more picky with that because of the number of features provided by the packages I maintain. It would be a nightmare to memorize hundreds of function names that are not explicitly connected in a type hierarchy of methods.

---

<div class="post-metadata">

**Author:** ![lilachint](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lilachint](https://discourse.julialang.org/u/lilachint)\
**Post date:** [May 1, 2026, 3:41am UTC](https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849/24 "2026-05-01T03:41:03Z")

</div>

To add a note, the usage of `!`-postfix in function names is sometimes unintuitive. Julia suggests using `!`s **only** when the function itself modifies its arguments. However, what if the function is a function factory that returns another function? For instance, `Fix{N}` does not have `!`, but it allows mutating functions to be passed to it. In the case of anonymous usage of such functions, i.e. without storing the resulting function in a global const, it could be misleading.

---

<div class="post-metadata">

**Author:** ![eldee](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@eldee](https://discourse.julialang.org/u/eldee)\
**Post date:** [May 1, 2026, 7:18am UTC](https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849/25 "2026-05-01T07:18:44Z")

</div>

> [@lilachint](#):
>
> For instance, `Fix{N}` does not have `!`, but it allows mutating functions to be passed to it. In the case of anonymous usage of such functions, i.e. without storing the resulting function in a global const, it could be misleading.

I don’t see the issue here? If you don’t assign the anonymous function to a variable, your original `!` function is still directly visible. If you do assign it to a variable (possibly local or non-const), you can just add a `!` to the name.

```julia-repl
julia> f!(x, s) = x .+= s; x = rand(2)
2-element Vector{Float64}:
 0.8772536942598435
 0.34042814275432287

julia> Base.Fix{2}(f!, 1)(x); x # Mutates, as there's an !
2-element Vector{Float64}:
 1.8772536942598435
 1.3404281427543228

julia> g! = Base.Fix{2}(f!, 1); 

julia> g!(x); x # g! clearly mutates
2-element Vector{Float64}:
 2.8772536942598435
 2.3404281427543228
```

---

<div class="post-metadata">

**Author:** ![lilachint](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lilachint](https://discourse.julialang.org/u/lilachint)\
**Post date:** [May 2, 2026, 3:35am UTC](https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849/26 "2026-05-02T03:35:02Z")

</div>

That makes total sense, I’m not thoughtful enough.

[Previous page](https://discourse.julialang.org/t/the-current-state-of-function-naming-style/136849.md?page=1)
