inaka / erlang_guidelines

Inaka's Erlang Coding Guidelines
Apache License 2.0
623 stars 121 forks source link

Atom casing #91

Open elbrujohalcon opened 4 years ago

elbrujohalcon commented 4 years ago

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.