CamelCase: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{#addbodyclass:tag_tech}} | |||
Latest revision as of 23:20, 20 June 2024
snake_case, also known as using underscores, typically just with lowercase naming
CamelCase is using capitals
- though there is a useful distinction between lowerCamelCase and UpperCamelCase (then a.k.a. PascalCase),
This is used e.g. in programming languages - where there are sometimes added names for these choices.
whether to use underscores or camelcase, and what for, is one of those arguments withing the programming world, mostly arguing about which is easier to type and/or read.
In the languages I work in, people seem to agree that
CONSTANTS ClassNames variable_names
but they disagree between
functionNames function_names
Other naming conventions
The point of the distinctions are often to make it easier to guess the purpose or type of a thing based on just the name, rather than having to check.
In that area there are further conventions, like
- using _ for variables you'll ignore
- using
- is_something or has_something for a human-readable suggestion that something returns a boolean
- do_something to suggest it's something and probably with side effects
https://en.wikipedia.org/wiki/Naming_convention_(programming)#Multiple-word_identifiers