Conventions about acronyms in module/project name?

Let’s take the name “CharlieHR” as an example, where there’s a word and an acronym in it.

How would you name the Elixir project after it then?

defmodule CharliehrWeb.Endpoint do # 1
defmodule CharlieHRWeb.Endpoint do # 2

Or would you just drop the acronym as it’s not necessary?

defmodule CharlieWeb.Endpoint do # 3

I’m guessing it must be 1st or 3rd option, not 2nd as it goes against the camel case. Let me know what you think :eyes:

I think about this probably more than I should, lol.

I really dislike acronyms in code unless they are universal. HR is actually a good example of this, but I hate camelcase acronyms in the middle of identifiers more than anything so in this case I’d just go with Charlie, but that’s just me. I guess I’d pick CharlieHR over Charliehr :thinking: I suppose there is a chance a library could pop up named Charlie then you’re in trouble, but not that much trouble as Elixir apps are surprisingly easy to rename!

1 Like

I prefer the CharlieHr, HttpClient over HTTPClient. Initially, I didn’t like it but after so many years of reading nonsense like CPSSGEClick I’ve come round to that way.

3 Likes

The convention in the stdlib docs is to uppercase it, so HR it is.