erlang_guidelines icon indicating copy to clipboard operation
erlang_guidelines copied to clipboard

Atom casing

Open elbrujohalcon opened this issue 4 years ago • 0 comments


snake_case for module names, function names, and atoms in general

Use snake_case for module names, function names and atoms in general and avoid uppercase letters in them.

-module(good_module).

good_function_name(a_good_atom) ->
    {ok, [is, a, reasonable_atom, to, use].

badFunctionName(a_Bad_Atom) ->
    try tO:avoidTheUsage() of
        pascalCase -> or_Bad_Snake_Case
    catch
        _ -> 'please!'
    end.

Reasoning: This is the convention adopted by most open-source erlang projects (and by OTP itself, to some extent). Using it would make your code more clear and readable for everybody.


elbrujohalcon avatar Jun 23 '20 13:06 elbrujohalcon