erlang_guidelines icon indicating copy to clipboard operation
erlang_guidelines copied to clipboard

Variable name casing

Open elbrujohalcon opened this issue 4 years ago • 0 comments


PascalCase for variable names

Use PascalCase for variable names and don't include underscores in between words.

good(These, VariableNames) ->
    TCPSocket = new_socket(),
    [These | are(very, good, VariableNames)].

bad(THESE, Variable_Names) ->
    Tcp_socket = new_socket(),
    [THESE | are(very, bad, Variable_Names)].

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