# Unicode: a bad idea, in general

**URL:** <https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897>\
**Category:** General Usage\
**Created:** [June 5, 2023, 3:25pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897 "2023-06-05T15:25:07Z")\
**Posts on this page:** 1\
**Showing post:** 36

<div class="post-metadata">

**Author:** ![moble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moble/32/23535_2.png) [@moble](https://discourse.julialang.org/u/moble)\
**Post date:** [June 6, 2023, 5:39pm UTC](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897/36 "2023-06-06T17:39:37Z")

</div>

> [@Ronis\_BR](#):
>
> I try to avoid, however, UTF-8 symbols in the API (like in keywords) but I am also starting to change my mind even in this point.

I hesitate to add my two cents, for all the derision I’m sure to attract for going overboard, but personally I come down _very_ strongly on the side of using UTF-8 in my own code, while ensuring that the API _allows_ people to use either UTF-8 or ASCII.

My community’s literature has very strong and fairly consistent conventions for a lot of variables, so it really helps to make the code look familiar. On the other hand, my highest-level API will often be used from python, where even something like `M₁` is not allowed. So I make sure that my API accepts keywords in _both_ forms with code like this:

```julia
function orbital_evolution(
    M₁, M₂, χ⃗₁, χ⃗₂, Ωᵢ;
    Lambda_1=0, Lambda_2=0, Omega_1=Ωᵢ,
    Λ₁=Lambda_1, Λ₂=Lambda_2, Ω₁=Omega_1
)
    # Code that only uses the Λ₁, Λ₂, Ω₁ forms

```

Yes, it’s possible for users to pass both forms of the keywords and one will be thrown away, but the documentation only suggests that it is possible to use one or the other, so I don’t think it will come up. And now, I can make beautiful calls like

```julia
orbital_evolution(M₁, M₂, χ⃗₁, χ⃗₂, Ωᵢ; Λ₁, Λ₂)

```

while the spoilsports (🙂) would probably write that as

```python
orbital_evolution(M_1, M_2, chi_1, chi_2, Omega_i, Lambda_1=Lambda_1, Lambda_2=Lambda_2)

```

Similarly, some function names can be made pretty, while allowing ugly calls:

```julia
μ(M₁, M₂) = (M₁ * M₂) / (M₁ + M₂)
const reduced_mass = μ

```

I may be opinionated, but my APIs can be flexible.

---

_[View the full topic](https://discourse.julialang.org/t/unicode-a-bad-idea-in-general/99897)._
