# Should global consts that are Refs be UPPER\_SNAKE\_CASE?

**URL:** <https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024>\
**Category:** General Usage\
**Tags:** question, style\
**Created:** [August 24, 2026, 4:57pm UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024 "2026-08-24T16:57:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Post date:** [August 24, 2026, 4:57pm UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/1 "2026-08-24T16:57:14Z")

</div>

Should global consts that are Refs be UPPER\_SNAKE\_CASE? What do you think, and why?

It seems that there is no consensus among existing code.

The ecosystem is split:

> **[JuliaHub](https://platform.juliahub.com/ui/Search?type=code&q=const+.*Ref&rx=true)**

The docs say “follow Base”

> **[Use naming conventions consistent with Julia base/ - Style Guide · The Julia...](https://docs.julialang.org/en/v1.12/manual/style-guide/#Use-naming-conventions-consistent-with-Julia-base/)**
>
> The following sections explain a few aspects of idiomatic Julia coding style. None of these rules are absolute; they are only suggestions to help familiarize you with the language and to help you choose among alternative designs. | Documentation for...

The 1.13-dev docs also say “use UPPER\_SNAKE\_CASE”

> **[Use naming conventions consistent with Julia base/ - Style Guide · The Julia...](https://docs.julialang.org/en/v1.13.0-rc3/manual/style-guide/#Use-naming-conventions-consistent-with-Julia-base/)**
>
> The following sections explain a few aspects of idiomatic Julia coding style. None of these rules are absolute; they are only suggestions to help familiarize you with the language and to help you choose among alternative designs. | Documentation for...

Base is split:

```julia
julia> filter(name -> getglobal(Base, name) isa Ref, names(Base,all=true))
16-element Vector{Symbol}:
 :ACTIVE_PROJECT
 :C_NULL
 :ENABLE_PRECOMPILE_WARNINGS
 :HOME_PROJECT
 :LOADING_CACHE
 :MAX_NUM_PRECOMPILE_FILES
 :PKG_PRECOMPILE_HOOK
 :PRECOMPILE_TRACE_COMPILE
 :REFLECTION_COMPILER
 :REPL_MODULE_REF
 :_regex_opts_str
 :_require_world_age
 :_track_dependencies
 :methodloc_callback
 :toplevel_load
 :update_stackframes_callback

```

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [August 25, 2026, 1:09am UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/2 "2026-08-25T01:09:07Z")

</div>

Is there still a reason to use a global `Ref`? Why not use a typed global?

In any case, a mutable constant is not a constant in my book, so deserves lower-case IMHO.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 25, 2026, 2:06am UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/3 "2026-08-25T02:06:46Z")

</div>

> [@cstjean](#):
>
> In any case, a mutable constant is not a constant in my book, so deserves lower-case IMHO.

It’s still nice when reading code to be able to instantly distinguish global state from local state…

---

<div class="post-metadata">

**Author:** ![pitsianis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pitsianis/32/26588_2.png) [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Post date:** [August 25, 2026, 6:32am UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/4 "2026-08-25T06:32:36Z")

</div>

Perhaps we need more “dimensions”, bold, italic, underlined, for more expressibility?

---

<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:** [August 25, 2026, 9:08am UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/5 "2026-08-25T09:08:49Z")

</div>

Agreed. I typically use `UPPER_SNAKE_CASE` for all globals\[1\], regardless of their `const`-ness.

* * *

1. Unless they are simple aliases for functions/types etc.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 25, 2026, 11:39am UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/6 "2026-08-25T11:39:26Z")

</div>

> [@pitsianis](#):
>
> Perhaps we need more “dimensions”, bold, italic, underlined, for more expressibility?

We have far [more options than most people realize](https://yaytext.com/):

```julia-auto
julia> 𝐛𝐨𝐥𝐝 = 1
1

julia> 𝑖𝑡𝑎𝑙𝑖𝑐 = 2
2

julia> 𝕱𝕽𝕬𝕶𝕿𝖀𝕽 = 3
3

julia> 𝓈𝒸𝓇𝒾𝓅𝓉 = 4
4

julia> u͟n͟d͟e͟r͟l͟i͟n͟e͟d͟ = 5
5

```

For variables that you shouldn’t take seriously, the standard convention in Julia is to use emoji:

```julia-auto
julia> 🤔 = missing
missing

```

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [August 25, 2026, 12:27pm UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/7 "2026-08-25T12:27:03Z")

</div>

I also use upper case snake for global variables, though I only have constant ones and very few.

But maybe switching to emojis…

---

<div class="post-metadata">

**Author:** ![langestefan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/langestefan/32/207923_2.png) [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Post date:** [August 25, 2026, 12:34pm UTC](https://discourse.julialang.org/t/should-global-consts-that-are-refs-be-upper-snake-case/139024/8 "2026-08-25T12:34:55Z")

</div>

> [@stevengj](#):
>
> For variables that you shouldn’t take seriously, the standard convention in Julia is to use emoji:
> 
> ```julia-auto
> julia> 🤔 = missing
> missing
> 
> ```

And create truly cursed things like this:

```julia
🚀 = "JULIA"; 🐌 = "everything else"; ∑ = sum
📢(💬) = println("🌈✨ ", 💬, " ✨🌈")

@time ∑(x^2 for x ∈ 1:1_000_000) # 🏎️💨 FASTER THAN C (source: trust me 🤝)
📢("$(🚀) 🥇🏆 >>>>>>>>> $(🐌) 🗑️🔥 btw 😌")

```
