I know there are some rules and conventions for naming variables in programming, such as CamelCase , PascalCase , etc ...
What is the term used for a compound name variable (words separated by "_")?
Example: nome_da_variavel
I know there are some rules and conventions for naming variables in programming, such as CamelCase , PascalCase , etc ...
What is the term used for a compound name variable (words separated by "_")?
Example: nome_da_variavel
I know this underline separation by the name of Snake Case .
According to the Wikipedia reference, the name snake case was created by the Ruby community.
In some languages, it is common to see the use of snake_case for nomeclatures of some functions or variables, such as the Python language. It seems that the galley that develops in this language prefers to define functions or variables with this pattern.
Example:
def minha_funcao(**args):
pass
resultado = minha_funcao(1)
Commonly, in Python, we see the use of the snake case combined with the lowercase. Maybe that's why according to Wikipedia, the name used by the Python Style Guide was lower_case_with_underscores .
In PHP we also see this pattern being applied to functions and variables, and the small difference is that in cases of variables considered Super Global language, it is written in uppercase.
See:
$usuario_id = obter_id_usuario($_GET)
References:
Yes, this pattern is commonly called the snake_case , in this case: p).
There is no official name for this pattern, snake case was the name the Ruby community gave it (that's right, it was not the Python people).
The Python style guide calls this pattern < > lower_case_with_underscores
.