4
If variables declared as such:
var camelCase = "";
follow the pattern camelCase, what is the default name for variables that use the _
, as below?
ruby_var = "a questão vale 10 pontos =)"
4
If variables declared as such:
var camelCase = "";
follow the pattern camelCase, what is the default name for variables that use the _
, as below?
ruby_var = "a questão vale 10 pontos =)"
3
It is usually called Snake Case, or snake_case as some prefer. This style states that any space between the words that form a unique identifier is replaced by a undeline, since the identifier cannot contain spaces. Some understand that this makes the identifier more readable than other options like camelCase or Pascalcase that eliminate space and make the initial uppercase to indicate the next word.
I think it’s ugly, but that kind of thing is taste. Of course, you should use what everyone in that language usually uses, so your code gets less alien, so I tend to try to adopt the same language pattern, but not always.
Browser other questions tagged variables encoding-style nomenclature camel-case
You are not signed in. Login or sign up in order to post.
It’s called snake_case: https://www.chaseadams.io/posts/most-common-programming-casetypes/
– hkotsubo