Elixir Coding Conventions

I am a mentor on Exercism.IO. I had made a suggestion about using

do_XXX as the defp inner function of XX

They asked about other conventions. Do we have a standard list?
I could suggest pointing Credo at your code…

1 Like

I cannot find it again, but I recall @josevalim saying (somewhere on this forum) that where possible they’re moving away from using do_xxx and instead using either a private xxx function with a different arity (e.g. an accumulator as extra arg) or a more appropriately named private function.

1 Like

I would suggest to use the code formatter + Credo :slight_smile:

https://hexdocs.pm/elixir/naming-conventions.html
https://hexdocs.pm/elixir/syntax-reference.html
https://hexdocs.pm/elixir/library-guidelines.html

1 Like

Whoa, I was not aware of those pages.

Are there any points in those style guides which are not enforced by the code formatter?

2 Likes